Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I am trying to switch from Sun Java to OpenJDK. I am currently running Sun Java but am having trouble compiling a java progam so I want to switch ...
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    19

    Can't switch Java

    Hello,

    I am trying to switch from Sun Java to OpenJDK. I am currently running Sun Java but am having trouble compiling a java progam so I want to switch to OpenJDK which I already have installed. I would like to post the output from the terminal to show what I did, however, I keep getting a message saying that I cannot post a url until I have 15 posts or more despite the fact that I am not posting a url but the output from a terminal.

    Originally, Java was set to Sun Java. Now the + is indicating that Open Java is running but when I check the version, I am getting Sun Java. Also, there is an asterisk by Sun Java and I am not sure what it means. Could this mean that Sun Java is still the active Java? Also, please tell me how to post output from terminal. I tried using plain text, code, quote and php tags but I keep getting that stupid url message.

  2. #2
    Just Joined!
    Join Date
    Feb 2008
    Posts
    19
    Post number 15.

  3. #3
    Just Joined!
    Join Date
    Feb 2008
    Posts
    19
    Post number 16. Here is the output from the terminal.
    Code:
    [root@hopchewer hopchewer]# /usr/sbin/alternatives --config java
    
    There are 4 programs which provide 'java'.
    
      Selection    Command
    -----------------------------------------------
     + 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
       2           /opt/jre1.6.0_14/bin/java
    *  3           /usr/lib/jvm/jre-1.6.0u13-sun-i586/bin/java
       4           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
    
    Enter to keep the current selection[+], or type selection number: 1
    [root@hopchewer hopchewer]# which java
    /opt/jre1.6.0_14/bin/java
    [root@hopchewer hopchewer]# /usr/sbin/alternatives --config java
    
    There are 4 programs which provide 'java'.
    
      Selection    Command
    -----------------------------------------------
     + 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
       2           /opt/jre1.6.0_14/bin/java
    *  3           /usr/lib/jvm/jre-1.6.0u13-sun-i586/bin/java
       4           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
    
    Enter to keep the current selection[+], or type selection number: 1
    [root@hopchewer hopchewer]# /usr/sbin/alternatives --config libjavaplugin.so
    
    There are 2 programs which provide 'libjavaplugin.so'.
    
      Selection    Command
    -----------------------------------------------
     + 1           /usr/lib/jvm/jre-1.6.0-openjdk/lib/i386/IcedTeaPlugin.so
    *  2           /usr/lib/jvm/jre-1.6.0u13-sun-i586/plugin/i386/ns7/libjavaplugin_oji.so
    
    Enter to keep the current selection[+], or type selection number: 1
    [root@hopchewer hopchewer]# java -version
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)
    [root@hopchewer hopchewer]#

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...