3 Replies Latest reply: Jun 22, 2012 6:22 AM by Peter Hartgerink RSS

    Java version issues in Oracle LInux 5.2 (need JDK 6u33 to be "visible")

    Peter Hartgerink
      System setup :
      - Windows 7 Professional 64 bit
      - Oracle Linux 5.2 running inside Oracle VBox
      - Oracle 11.2 XE
      - Oracle SQLDeveloper 3.1.07.42-1

      To support SQLDeveloper, I downloaded and installed JDK (jdk-6u33 as recommended for SQLDeveloper). No obvious issues with installation, everything seemed to be successful based on messages. However, SQLDeveloper isn't launching properly, and when troubleshooting this I discovered that the system "sees" a much earlier version of Java (1.4.2)

      [root@localhost jdk]# java -version
      java version "1.4.2"
      gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42)

      I downloaded the JDK rpm a second time just to be sure and re-installed it. Again, everything seemed to be OK but the java version still shows as 1.4.2

      So before I do any further troubleshooting on my SQLDeveloper installation, I need to get Linux to recognize the correct Java version.

      I'm not that experienced with Linux and would appreciate some help . Is it possible to "uninstall" the outdated version? Would this help? Are there logs of the JDK installation that I can check? Any help would be appreciated.

      Thanks !
        • 1. Re: Java version issues in Oracle LInux 5.2 (need JDK 6u33 to be "visible")
          Avi Miller-Oracle
          Peter Hartgerink wrote:
          I'm not that experienced with Linux and would appreciate some help . Is it possible to "uninstall" the outdated version? Would this help? Are there logs of the JDK installation that I can check? Any help would be appreciated.
          Option 1: install the <tt>java-1.6.0-openjdk</tt> package that's included with OL5 instead of the Sun Java package. This will provide you with the OpenJDK 6.
          Option 2: Run <tt># alternatives --config java</tt>to configure which java binary is used by default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
          • 2. Re: Java version issues in Oracle LInux 5.2 (need JDK 6u33 to be "visible")
            Dude!
            The following should work:

            <pre>
            su - root

            # java -version
            java version "1.4.2"
            </pre>

            Download and install the version for your platform x86 (i585) or jdk-6u33-linux-x64-rpm.bin (x86_64 ) from
            http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html

            <pre>
            # chmod u+x jdk-6u33-linux-x64-rpm.bin
            # ./jdk-6u33-linux-x64-rpm.bin
            </pre>

            Register the Java installation:

            <pre>
            # alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_33/bin/java 2
            </pre>

            Change the default java version:

            <pre>
            # alternatives --config java
            Select 2
            </pre>

            Test if it works:

            <pre>
            # su - dude
            $ java -version
            java version "1.6.0_33"
            Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
            Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)
            </pre>
            • 3. Re: Java version issues in Oracle LInux 5.2 (need JDK 6u33 to be "visible")
              Peter Hartgerink
              Thanks, Dude. I really appreciate the help. Worked beautifully.