4 Replies Latest reply: Oct 30, 2012 10:53 PM by 829510 RSS

    how can i remove jdk1.4 install in oracle unbreakable linux.

    829510
      I am able to comple java program in oracle unbreakable linux but not able to run program.this is simple hello world program there is no syntax problem .I am getting error:

      Exception in thread Main java.lang.class format error:unrecognised class file version and i also checked :=> #javac -version
      #jdk1.6_20
      #java -version
      #jadk1.4 (gnu support java)
      How can i unstall jdk1.4 gnu jdk/bin path and jdk 1.4 gnu java from with my system.
      Regards
      Prashansh Kumar
        • 1. Re: how can i remove jdk1.4 install in oracle unbreakable linux.
          Catch_22
          From what I understand, the problem is that your classes are compiled for a later version of Java. I'm not sure at this point that uninstalling Java 1.4 is the right solution - it may break important system functions.

          I would rather try another approach first:

          # alternatives --config java
          -> select the java version you want as default.
          If you want to install java 1.6 you can try the following:
          # yum install java-1.6*
          or just the runtime package
          # yum install java-1.6.0-openjdk
          
          For example:
          
          # java -version
          java version "1.4.2"
          
          # yum install java-1.6.0-openjdk
          # 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.6.0-openjdk.x86_64/bin/java
          
          Enter to keep the current selection[+], or type selection number: 2
          
          # java -version
          java version "1.6.0"
          • 2. Re: how can i remove jdk1.4 install in oracle unbreakable linux.
            829510
            Dear Dude

            I installed jdk1.6 rather than java run time environment.I already installed jdk1.6.I am able to compile with
            javac program.java but i am not able to run java program with this command java program.

            regards
            Prasathi
            • 3. Re: how can i remove jdk1.4 install in oracle unbreakable linux.
              Catch_22
              What I was wondering about: You compiled with java 1.6, but java -version still reports 1.4. I think your problem is that you will also need to use java 1.6. From what I understand, uninstalling java 1.4 does not mean it will automatically switch to 1.6. But you could try to choose and change your default java to be 1.6 as I outlined above.

              To uninstall 1.4 I suppose you could try sudo yum remove java-1.4*, but I would rather try to simply switch the default java first.

              Edited by: Dude on Apr 15, 2011 1:09 AM
              • 4. Re: how can i remove jdk1.4 install in oracle unbreakable linux.
                829510
                Answered.Please lock this thread.