[CentOS] Java installation problem. -- Alternatives ...

Sun Aug 7 22:54:16 UTC 2005
Jay Leafey <jay.leafey at mindless.com>

I don't know if this is much use, but here's the command I used to add 
the Sun JDK to alternatives after I installed the RPM (look out for line 
wrap):

alternatives \
     --install /usr/bin/java java /usr/java/jdk1.5.0_04/jre/bin/java 10 \
     --slave /usr/bin/rmiregistry rmiregistry \
         /usr/java/jdk1.5.0_04/jre/bin/rmiregistry \
     --slave /usr/lib/jvm/jre jre /usr/java/jdk1.5.0_04/jre

This sets all of the slaves except jre_exports, which I could not seem 
to find in the Sun JDK.  Anybody got any ideas on what this should 
actually point to?

Anyway, I then used the command 'alternatives --set java 
/usr/java/jdk1.5.0_04/jre/bin/java' to switch over to using the Sun 
Java.  Heres what the alternatives output looks like afterwards:

[root at jaybird ~]# alternatives --display java
java - status is manual.
  link currently points to /usr/java/jdk1.5.0_04/jre/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
  slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
  slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
  slave jre: /usr/lib/jvm/jre-1.4.2-gcj
/usr/java/jdk1.5.0_04/jre/bin/java - priority 10
  slave rmiregistry: /usr/java/jdk1.5.0_04/jre/bin/rmiregistry
  slave jre_exports: (null)
  slave jre: /usr/java/jdk1.5.0_04/jre
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java.
[root at jaybird ~]# java -version
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)

The reason the GCJ version shows up as the 'best' is because it has a 
higher priority (1420) than the Sun version (10).  Just change the 
priority in the 'alternatives --install' command listed above to 
something higher than 1420 and the Sun version will become the 'best' 
version.

Just my $.02.
-- 
Jay Leafey - Memphis, TN
jay.leafey at mindless.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5322 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20050807/79dcde01/attachment-0004.bin>