I’m trying to set up an entire java dev environment with STS / Eclipse and this is just the first step. Hopefully it is the right first step, I’ll keep you updated.

Informal notes:

Open a terminal
Since the repo isn’t available by default add it to apt by running this command:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

To get those changes:
sudo apt-get update

then run
sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk