Installing Java6 JDK on Ubuntu 11.10

UPDATE: To install on 12.04 (Precise Pangolin) you need a different PPA.

Since sun-java6-jdk has been removed from the default Ubuntu 11.10 (Oneiric Ocelot) repositories you need to add a PPA repository (unless you want to install by hand)

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin