Thursday, May 17, 2012

Installing the 64-bit JDK 6 an Ubuntu 11.04 Slice

After reading the instructions here and here, below are the steps of what I did to get the 64-bit version of JDK 6 installed on a 256MB VPS from Slicehost running Ubuntu 11.04 (aka Natty).

 NOTE: You will need to first of all download the x64 binary using a browser that supports cookies in order to correctly accept the Oracle terms of use before the download can commence.

 $ wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-x64.bin
 $ chmod u+x jdk-6u31-linux-x64.bin
 $ ./jdk-6u31-linux-x64.bin [Press 'Enter' when installation completes]
 $ sudo mv ./jdk1.6.0_31 /usr/lib/jvm/
 $ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_31/bin/java" 1
 $ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_31/bin/javac" 1
 $ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_31/bin/javaws" 1
 $ sudo update-alternatives --config java