I got this error when I tried to install java on Ubuntu 10.04
E: Package sun-java6-jdk has no installation candidate ubuntu 10.04
to get rid of this I added
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
and then I was able to install
Then I need to set JAVA_HOME and JRE_HOME
find where is java
so I did
find / -name java
in second line is java6-sun that is what I needed
Step 2) in /etc/profile added following lines
Step 3 ) Note in above I have kept JAVA_HOME before $PATH in third line so as to give priority to sun java on the default java of Ubuntu.
In other wise case it will first search for /usr/bin/java and not
which is what I need.