Adsense 1

Monday, November 02, 2009

Installing Java in Ubuntu 9.04

I was trying to install the latest java version for firefox in Ubuntu 9.04. Current sun-java version available from Jaunty archives is jre1.6u14, while the latest in java site (as of now) is jre1.6u16
Go to this link: http://java.sun.com/javase/downloads/index.jsp and downloaded latest jdk as of today it is jdk-6u16.

Open terminal and cd to the download directory.
$ chmod u+x jdk-6u16-linux-i586.bin
$ sudo mkdir /usr/java
$ sudo mv jdk-6u16-linux-i586.bin /usr/java
$ cd /usr/java
$ sudo ./jdk-6u16-linux-i586.bin
Accept the license agreement and proceed installing. This will install java in the directory /usr/java/jdk1.6.0_16/

Now we have to point the system to new installed path. Do this:
$ sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_16/jre/bin/java 2;$ sudo update-alternatives --config java 
Output will be:
There are 3 alternatives which provide `java'.

Selection Alternative
------------------------------ -----------------
+ 1 /usr/lib/jvm/java-6-sun/jre/bin/java
2 /usr/java/jre1.6.0_15/bin/java
* 3 /usr/java/jdk1.6.0_16/jre/bin/java

Press enter to keep the default[*], or type selection number:
I selected 3. Now we will have to point the new java plugin path in firefox.
$ cd /usr/lib/firefox-addons/plugins/ ; sudo ln -s /usr/java/jdk1.6.0_16/jre/plugin/i386/ns7/libjavaplugin_oji.so;$ cd /usr/lib/firefox/plugins/ ; sudo ln -s /usr/java/jdk1.6.0_16/jre/plugin/i386/ns7/libjavaplugin_oji.so
Note that firefox saw the latest plugin only after i linked it to both the directories. Then the new version started working.