Monday, December 25, 2006

Java 6 runtime on Ubuntu dapper

As Java SE 1.6 is officially out, I thought of getting JRE 1.6 to be the default in my Ubuntu.
Java 1.6 is super fast with a lot of UI related improvements. So, always good to have.
So, if you want to have it, do the following:
1. Download the *.bin file from sun's dowload location.
http://java.sun.com/javase/downloads/index.jsp
If you are not a "Java dude", just choose to download the "Java Runtime Environment (JRE) 6"

2. Run a terminal session, and goto the folder where jre-6-linux-i586.bin is downloaded.

3. make sure that it is "executable"
chmod +x jre-6-linux-i586.bin

4. Run the installer
sudo ./jre-6-linux-i586.bin

5. This will extract the JRE in to its own folder(called jre1.6.0. Now, put this into appropriate library location

sudo mv jre1.6.0 /usr/lib/jvm

6. Set new JRE as one of the "java alternatives" as (all in one line)
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.6.0/bin/java" 1

7. Set the new "alternative" as the real java to run (all in one line)
sudo update-alternatives --set java /usr/lib/jvm/jre1.6.0/bin/java

This should print a message - Using `/usr/lib/jvm/jre1.6.0/bin/java' to provide `java'.
We are all set!
Oh and, happy christmas! let there be peace and joy - forever!

1 comment:

Anonymous said...

I had to alter the steps 6-7 to:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/bin/java" 1

sudo update-alternatives --set java /usr/lib/jvm/bin/java

Using `/usr/lib/jvm/bin/java' to provide `java'

Thank you for this anyway.