Saturday, August 1, 2009

Ubuntu , Sun Java JDK and Eclipse

For some reason, I had installed Eclipse on my system and as a dependency it pulled java-gcj packages along with it and if JAVA_HOME is not set, it ends up using java-gcj packages.
BTW, I have a question is java-gcj the same as OpenJDK? (which went through Sun's certification recently)?
Any way, I've for all my purposes (well, a very less # them) had used Sun's JDK and JRE all my life and did not want to move to another JDK and JRE.
I had already installed using Synaptic sun-java6-jdk and related packages
However, after the installation of Eclipse, it always uses the java-gcj binaries and not the Sun's Java binaries.
What to do? Ubuntu's help at work again. Thank you Ubuntu's Documentation team!

Here is the link:

Below are the commands:

update-java-alternatives -l

Should list you the possible alternatives
To choose Sun's java/JDK

sudo update-java-alternatives -s java-6-sun


and ofcourse, I've had to set the JAVA_HOME in /etc/profile
Valla, now eclipse uses Sun's JDK and JRE :)