Ok, I wanted to post this, but I will just complete your post:
Lastly, Eclipse for some reason ignores Ubuntu's JVM configuration file and uses its own (bug?). You need to edit eclipes's java_home file
Code:
sudo -b gedit /etc/eclipse/java_home
Well, this is because of the Eclipse init script.Let's look at the script a little (/usr/bin/eclipse) :
Code:
.....
# If the user has specified a custom JAVA, we check it for validity.
# JAVA defines the virtual machine that Eclipse will use to launch itself.
if [ -n "${JAVA_HOME}" ]; then
echo "using specified vm: ${JAVA_HOME}"
.....
# If the user has not set JAVA_HOME, cycle through our list of compatible VM's
# and pick the first one that exists.
if [ -z "${JAVA_HOME}" -a ! -n "${JAVACMD}" ]; then
echo "searching for compatible vm..."
javahomelist=`cat /etc/eclipse/java_home | grep -v '^#' | grep -v '^$' | while read line ; do echo -n $line ; echo -n ":" ; done`
OFS="$IFS"
IFS=":"
for JAVA_HOME in $javahomelist ; do
echo -n " testing ${JAVA_HOME}..."
....
Ok, so what we see here is this: Eclipse searches for the Environment variable named JAVA_HOME which you should have set.If it does not find it, it will go through the vm-s in its list /etc/eclipse/java_home.
So, we try to see if the script works:
Code:
~$ export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun
$ eclipse
using specified vm: /usr/lib/jvm/java-1.5.0-sun
........
That is, the script works just fine if you set the env variable.
For a permanent setting add it to ~/.bashrc or ~/.bash_profile or whatever you use for your profile (I think .bashrc is default)
PS: At configuring the update alternatives.You can just do the old way and simbolic link applications in /usr/bin to the correct applications.Like :
Code:
ln -sf /usr/lib/jvm/java-1.5.0-sun/bin/java java
I don't know if it is correct or not, but this is how I did it.
And I also have a javah in my /usr/bin maybe you should list that too in your list.
Greets,
Matei
Bookmarks