I have a little to add to Jesper's detailed post-
To set ALL the java related symlink automatically to the Sun version of Java (e.g. apt, servtool, jar, javap etc.) do this:
sudo update-java-alternatives --set java-6-sun Also, please DO NOT use the official Sun tarballs to install JDK - that way the JDK is not registered with the package manager and alternatives system, and more often than not the firefox plugin won't work either.
Incidentally, the JAVA_HOME variable is not set by the package manager, because it is assumed that all java software will be installed using the package manager, and that doesn't need JAVA_HOME variable set.
This is not always the case, for example I had to install
maven manually, which requires that variable. Hence I have added this line to by
~/.bashrc file:
[ -d /usr/lib/jvm/java-6-sun-1.6.0.03 ] && export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.03 Hope that helps
[ January 07, 2008: Message edited by: Rohan Dhruva ]