If you try to install “sun-java6-jdk” package on Ubuntu from command line, it may say that this package is not available. For that you have to add canonical repository, follow the instruction given below to get installed JDK on your pc.
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
Now, update your repository and install “sun-java6-jdk” package:
$ sudo apt-get update
$ sudo apt-get install sun-java6-bin sun-java6-fonts sun-java6-jdk sun-java6-jre sun-java6-plugin