Wednesday, July 1, 2009

JAVA on Ubuntu 10.04 server edition

I got this error when I tried to install java on Ubuntu 10.04
apt-get sun-java6-sdk

E: Package sun-java6-jdk has no installation candidate ubuntu 10.04

to get rid of this I added

sudo add-apt-repository "deb 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
Step 1)
find / -name java

I got


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.