Why can't I select the Sun Java VM ?

Linuxguy123 linuxguy123 at gmail.com
Sun Nov 30 14:40:34 UTC 2008


# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
 + 2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java

So it thinks I have 2 versions of Java.

Here is the first:

# java -version
java version "1.6.0_0"
IcedTea6 1.4 (6b12-Fedora-10) Runtime Environment (build 1.6.0_0-b12)
OpenJDK Server VM (build 10.0-b19, mixed mode)

Here is the second:

# java -version
java version "1.5.0"
gij (GNU libgcj) version 4.3.2 20081105 (Red Hat 4.3.2-7)

However, I actually have 3 versions of Java, because I installed the Sun
Java from a Sun rpm:

# rpm -ql jre                                    
/usr/java/jre1.5.0_15/CHANGES                                        
/usr/java/jre1.5.0_15/COPYRIGHT                                      
/usr/java/jre1.5.0_15/LICENSE                                        
/usr/java/jre1.5.0_15/README                                         
/usr/java/jre1.5.0_15/THIRDPARTYLICENSEREADME.txt                    
/usr/java/jre1.5.0_15/Welcome.html                                   
/usr/java/jre1.5.0_15/bin                                            
/usr/java/jre1.5.0_15/bin/ControlPanel                               
/usr/java/jre1.5.0_15/bin/java               

If I test it it works fine. 

# /usr/java/jre1.5.0_15/bin/java -version
java version "1.5.0_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) Server VM (build 1.5.0_15-b04, mixed mode)

So I move it to /usr/lib/jvm and run again:

alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java

The Sun Java doesn't show up.

/usr/lib/jvm looks like this:

ls -al
total 204
drwxr-xr-x   5 root root   4096 .
drwxr-xr-x 183 root root 139264 ..
drwxr-xr-x   3 root root   4096 java-1.5.0-gcj-1.5.0.0
drwxr-xr-x   3 root root   4096 java-1.6.0-openjdk-1.6.0.0
lrwxrwxrwx   1 root root     21 jre -> /etc/alternatives/jre
lrwxrwxrwx   1 root root     27 jre-1.5.0 -> /etc/alternatives/jre_1.5.0
drwxr-xr-x   7 root root   4096 jre1.5.0_15
lrwxrwxrwx   1 root root     26 jre-1.5.0-gcj ->
java-1.5.0-gcj-1.5.0.0/jre
lrwxrwxrwx   1 root root     27 jre-1.6.0 -> /etc/alternatives/jre_1.6.0
lrwxrwxrwx   1 root root     30 jre-1.6.0-openjdk ->
java-1.6.0-openjdk-1.6.0.0/jre
lrwxrwxrwx   1 root root     25 jre-gcj -> /etc/alternatives/jre_gcj
lrwxrwxrwx   1 root root     29 jre-openjdk
-> /etc/alternatives/jre_openjdk

How do I get the Sun java to be the default Java, without doing a 24
step build that Googling finds ?

Thanks










More information about the fedora-list mailing list