You need to ensure that apt-get is pointed at the right place. In /etc/apt/sources.list add in the following:
deb http://us.archive.ubuntu.com/ubuntu dapper main restricted
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse
After this have apt updates its repository:
sudo apt-get update
And finally, just tell it to install Java 1.5:
sudo apt-get install sun-java5-jdk
You can check Java is installed correctly by typing:
java -version
[Adapted from http://www.javalobby.org/java/forums/t72809.html]
May 21, 2007 at 12:25 pm
[...] these instructions to install if [...]