Installing JDK on Ubuntu (Hoary 2005.04)

To install the Java Development Package (1.5.0.x) I did the following.

I added multiverse to my repository settings (the following are valid for Internode customers only.

deb ftp://mirror.internode.on.net/pub/ubuntu/ubuntu/ hoary main restricted universe multiverse
deb-src ftp://mirror.internode.on.net/pub/ubuntu/ubuntu/ hoary main restricted universe multiverse
deb ftp://mirror.internode.on.net/pub/ubuntu/ubuntu/ hoary-updates main restricted universe multiverse
deb-src ftp://mirror.internode.on.net/pub/ubuntu/ubuntu/ hoary-updates main restricted universe multiverse
deb ftp://mirror.internode.on.net/pub/ubuntu/ubuntu/ hoary-security main restricted universe multiverse
deb-src ftp://mirror.internode.on.net/pub/ubuntu/ubuntu/ hoary-security main restricted universe multiverse
deb ftp://mirror.internode.on.net/pub/ubuntu/ubuntu/ hoary-backports main restricted universe multiverse
deb-src ftp://mirror.internode.on.net/pub/ubuntu/ubuntu/ hoary-backports main restricted universe multiverse

Then apt-get update and install java-package and fakeroot

apt-get update
apt-get install java-package fakeroot

Edit /usr/share/java-package/sun-j2sdk.sh and add the following chunk

"jdk-1_5_0_04-linux-i586.bin")
j2se_version=1.5.0+update4
j2se_expected_min_size=87
found=true
;;

Visit Sun’s java site and download the latest Java package for Linux (without Netbeans and NOT in RPM format) download the Java Software Development Kit (J SDK) – The version today is 1.5.0 update4 and the rest of this article refers to this version.

Run the following command (not as root)
fakeroot make-jpkg jdk-1_5_0_04-linux-i586.bin
To install the freshly created package
sudo dpkg -i sun-j2sdk1.5_1.5.0+update04_i386.deb

As I already had the older J2RE installed I did the following commands – this ensures that existing links for mozilla plugins and runtimes uses the newer java, and are not broken – not clean, but mostly working.
sudo mv j2re1.5-sun j2re1.5-sun-disabled
sudo ln -s j2sdk1.5-sun ./j2re1.5-sun