Monday, September 10, 2012

Install the Oracle JDK 6

Install the Oracle JDK 6

Oracle themselves have the official guide to install their JDK - below is based upon those instructions.
  • Download the 32bit or 64bit Linux "compressed binary file" - it has a ".bin" file extension
  • Give it permissions to execute and extract it
    chmod a+x [version]-linux-i586.bin
    ./[version]-linux-i586.bin
During installation it will ask you to register - press ENTER. Firefox will open with the registration page. Registration is optional.
JDK 6 package is extracted into ./jdk1.6.0_x directory, for example ./jdk1.6.0_30.
Lets rename it:
mv jdk1.6.0_30 java-6-oracle
  • Now move the JDK 6 directory to /usr/lib
sudo mkdir /usr/lib/jvm
sudo mv java-6-oracle /usr/lib/jvm

switch to Oracle JDK 6

webupd8.googlecode.com hosts a nice-easy script to help with this.
wget http://webupd8.googlecode.com/files/update-java-0.5b
chmod +x update-java-0.5b
sudo ./update-java-0.5b
don't worry - 0.5b refers to the script version - not the version of java!
An alternative to this is to use the webupd8 ppa and the update-java package.
enter image description here
Finally test the switch has been successful:
java -version
javac -version

No comments:

Post a Comment