[svlug] Switching between gcj and sun java

Christian trapspam at trapspam.org
Thu Apr 5 13:03:16 PDT 2007


Hi Chris,

The update-alternatives command does what you want to do (that's why the
links are prepared in update-alternatives in the first place.

So the scripts should read

#!/bin/bash
export SUN=/usr/bin/jvm/java6/sun/bin
update-alternatives --set java $SUN/java
update-alternatives --set javac $SUN/javac
...

and

#!/bin/bash
export GCJ=/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/bin
update-alternatives --set java $GCJ/java
update-alternatives --set javac $GCJ/javac
...

You may need to adjust the $SUN variable to reflect the actual path to
your java binaries.

The update-alternatives mechanism is designed for the specific task you
are trying to do, so using the mechanism instead of custom linking files
is the better way to do it.

If you have any more questions, email me.

Christian
-- 
Christian Huebner
crh at trapspam.org






More information about the svlug mailing list