Most installation notes refer to the no longer available sun-java6-jdk or an individual ppm, but these notes are for manually installing the downloaded files from Oracle. I'm referring to JDK6
- Download Java SE 6 JDK for Linux x86 self-extracting binary
At the time of writing, the file I'm using is jdk-6u45-linux-i586.bin, but the filename will change as updates are released. - From the download folder, make the file executable
chmod a+x jdk-6u45-linux-i586.bin - Apparently there isn't a jvm folder anymore, so create one.
sudo mkdir /usr/lib/jvm - Move the file to the jvm folder
sudo mv jdk-6u45-linux-i586.bin /usr/lib/jvm/ - Change to the jvm folder and run the self-extracting binary
cd /usr/lib/jvm
sudo ./jdk-6u45-linux-i586.bin
Everything will be extracted to a new jdk1.6.0_32 folder and you can delete the .bin file now. - Make symbolic links to the new java binary.
sudo ln -s -b /usr/lib/jvm/jdk1.6.0_32/jre/bin/java /etc/alternatives/java
sudo ln -s -b /usr/lib/jvm/jdk1.6.0_32/jre/bin/java /usr/bin/java - Double-check the version
java -version
or
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse" sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse" sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" sudo apt-get update sudo apt-get install sun-java6-jdk