Installing sun-java6-jdk with apt-get on Ubuntu 10.04

The Sun/Oracle JDK package is no longer available in Ubuntu due to Oracle retiring the 'Operating System Distributor License for Java'. Story here.

Originally Canonical were going to make it so that existing installations of Sun's JRE/JDK would get removed on an apt-get update, but they reversed that decision (however updates/installs will no longer be available).

The recommendation is for users to transition to the OpenJDK 6 package. You can still install the Oracle JDK by downloading from Oracle's website, but it has to be done manually.


Also, you might find this blog post helpful. It worked for me and was totally painless (script install vs building your own Java package):

You can find the script and full usage instructions on github.

The quick and dirty guide for using this script is as follows:

cd ~/
wget https://github.com/flexiondotorg/oab-java6/raw/master/oab-java.sh -O oab-java6.sh
chmod +x oab-java6.sh
sudo ./oab-java6.sh
sudo apt-get update && sudo apt-get install sun-java6-jdk