There is a mildly annoying gotcha in the way FC4 manages the "java"
and "javac" alternatives. (To be fair, FC4 is merely following the
JPackage suit here.)
The way it works is this. If you install another JDK in addition to
GCJ, you have a choice of specifying your preferred alternative
systemwide like so:
| $ readlink -f /usr/bin/java
| /usr/bin/gij
| $ sudo /usr/sbin/alternatives --config java
|
| There are 2 programs which provide 'java'.
|
| Selection Command
| -----------------------------------------------
| + 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
| * 2 /usr/lib/jvm/jre-1.4.2-sun/bin/java
|
| Enter to keep the current selection[+], or type selection number: 2
| $ readlink -f /usr/bin/java
| /usr/lib/jvm/java-1.4.2-sun-1.4.2.08/jre/bin/java
Here's the rub. If you do this, you must remember to also change the
"javac" alternative. (In some cases, you may not care if your
/usr/bin/java and /usr/bin/javac are provided by different vendors.
In most cases, you probably want to be consistent.)
I wrote a script to change both "java" and "javac" alternatives in
one
fell swoop. Here's how it works:
| $ sudo ./alt-java
| spawn /usr/sbin/alternatives --config java
|
| There are 2 programs which provide 'java'.
|
| Selection Command
| -----------------------------------------------
| 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
| *+ 2 /usr/lib/jvm/jre-1.4.2-sun/bin/java
|
| Enter to keep the current selection[+], or type selection number: 1
| 1
| spawn /usr/sbin/alternatives --config javac
|
| There are 2 programs which provide 'javac'.
|
| Selection Command
| -----------------------------------------------
| 1 /usr/lib/jvm/java-1.4.2-gcj/bin/javac
| *+ 2 /usr/lib/jvm/java-1.4.2-sun/bin/javac
|
| Enter to keep the current selection[+], or type selection number: 1
I am attaching the script in hopes that someone else will find it useful.
------------------------------------------------------------------------------
Show replies by date