Wednesday, December 24, 2008

Static IP configuration on Ubuntu 8.10ic

1. Edit interfaces file

sudo gedit /etc/network/interfaces

add lines:

auto eth0
iface eth0 inet static

If there is a line like:

iface eth0 inet dhcp

need to add # before the line to comment it.

2. Edit file /etc/resolv.conf

sudo gedit /etc/resolv.conf

Add lines:


These are DNS, that might be different for different ISP

If you do only step 1, not step 2, you can only visite web site by using number IP not domain name.

3. Restart network

sudo /etc/init.d/networking restart

You should see the static IP you setup.

Note: the graphic thing (for net work configure) on the top bar is not working even I set up everything there.

Install Eclipse 3.4 (jee) in Ubuntu 8.10

Download packages

Java - Application--Add/Remove -- Programming to get the latest version, as the time this is written, the version is 1.6
There are many articles about the java installation.

Eclipse - Eclipse website -eclipse-jee-ganymede-SR1-linux-gtk.tar.gz
I download this one is because no plugin is required to run with Apache-tomcat

Tomcat -- apache website - the version i got is apache-tomcat-6.0.18.tar.gz

Install packages

Sun's Java JDK: Many ways to do this. there are many different way on the website. I will put one here later.


tar xzf apache-tomcat-6.0.18.tar.gz
sudo mv apache-tomcat-6.0.18 /usr/local
cd /usr/local
sudo chown -R root:root apache-tomcat-6.0.18
sudo chmod -R +r apache-tomcat-6.0.18
sudo chmod +x `sudo find apache-tomcat-6.0.18 -type d`
sudo ln -s apache-tomcat-6.0.18 tomcat

Edit tomcat users:
sudo gedit /usr/local/tomcat/conf/tomcat-users.xml

And add an admin and your username and password:

user name="admin" password="admin" roles="manager,admin"
user name="yourname" password="blah" roles="manager,admin"
Extract the eclipse download and move to opt.

tar zxvf eclipse-jee-ganymede-SR1-linux-gtk.tar.gz
sudo mv eclipse /opt/eclipse
cd /opt
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
sudo chmod +x `sudo find eclipse -type d`

Then create an eclipse executable in your path

sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudo gedit /usr/bin/eclipse

With this contents

#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*

Then create a gnome menu item

sudoedit /usr/share/applications/eclipse.desktop

With this contents

[Desktop Entry]
Comment=Eclipse IDE


You now have a working eclipse.
But run this command first to initialise the set up.

/opt/eclipse/eclipse -clean

Then from here on you can run from the menu item

Eclipse 3.4 (Ganymede) on Ubuntu

Eclipse Ganymede (the successor to Europa) has nice features that we are missing out on (Mylyn, inline renames, etc.).

Make sure that it is at least Java 5.

sudo apt-get install openjdk-6-jdk

Then update your ~./bashrc file, appending the JAVA_HOME (adjust this if you use a different JDK).

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/

Get Ganymede

tar xzvf eclipse-java-ganymede-linux-gtk.tar.gz
mv eclipse eclipse3.4

We should be ready to go:


And your nice new Eclipse is up and running.

Suggested Plugins
Eclipse is great because it has so many plugins. I even use it as my default Python editor. If you go to Help > Software Updates, you will see a vastly improved update dialog (the previous one was painful).

Update: As Scott points out in the comments, there is an open request on launchpad to include a more recent version of Eclipse in the Ubuntu repositories: