This post has been superseded by a newer posthttp://www.whiteboardcoder.com/2013/03/installing-java-7-on-ubuntu-1210.html
Looks like Oracle has finally pulled the plug on using apt-get to install Java6. According to this site
https://lists.ubuntu.com/archives/ubuntu-security-announce/2012-January/001554.html  the java package will no longer be available for easy apt-get downloads...
I used to be able to
> sudo pico /etc/apt/sources.list
Add the following at the bottom
deb http://archive.canonical.com/ lucid partner
Run this from the command line
> sudo apt-get update
Run this from the command line to install Java
> sudo apt-get install sun-java6-jdk
But that no longer works... Here are the steps I tool to install Java7 on my Ubuntu server.
And click on Download
Click on the “Accept License” Button then click on the version you want to download.
It used to be that you could then copy the link and use a wget from the command line to get the file, but no longer. So manually download the version you want.
> tar -xvf jre-7-linux-i586.tar.gz
Move JRE folder to /usr/lib
> sudo mkdir /usr/lib/jvm
> sudo mv jre1.7.0_03 /usr/lib/jvm/jre1.7.0_03
> sudo ln -fs /usr/lib/jvm/jre1.7.0_03/bin/java /usr/bin/java
Now if you run
> java -version
You should get the correct response
 Java Packages in Partner archive to be removed 2012-02-16