Install Sun/Oracle Java JDK/JRE 6u45 on Fedora 19/18, CentOS/RHEL 6.4/5.9 - Comment Page: 4

Please note: This guide still working normally if you want install Sun/Oracle Java 6, but if you want Java 8 version, then check Install Oracle Java JDK/JRE 8 on Fedora, CentOS/RHEL or if you want Java 7 version, then check Howto Install Sun/Oracle Java JDK/JRE 7 on Fedora, CentOS/Red Hat (RHEL). By default, Fedora 19/18/17/16/15/14/13/12 and CentOS/Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9 Linux operating systems use the OpenJDK Java, which is a good choice for normal use and it works with almost all the Java programs normally. OpenJDK is also easy to install and maintain with YUM package management, but some cases, Sun/Oracle Java installation is necessary, for example, if some program...

145 comments on “Install Sun/Oracle Java JDK/JRE 6u45 on Fedora 19/18, CentOS/RHEL 6.4/5.9 - Comment Page: 4

1 2 3 4 5
    1. unfortunately, it does not work for me. I am sure its somehow the configuration on my side.
      and I would appreciate some step by step help.
      I updated my Fedora 14 to 15. I have a x64 laptop. Firefox is 4.0.1. I followed instruction, even with different version of Java, but it didn’t help.

      weird thing is “alternatives –display libjavaplugin.so” does not return any thing.
      Please help.

      Reply
      • Hi Mike,

        Did you run:

        
        ## for JDK ##
        alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jdk1.6.0_26/jre/lib/amd64/libnpjp2.so 20000
        
        ## for JRE ##
        alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jre1.6.0_26/lib/amd64/libnpjp2.so 20000
        
        Reply
    2. Very nice JR. Excellent work!!!!

      Reply
    3. Trying to install latest version (this morning) of JRE6u26 on a clean (last night), updated (just now) install of Fedora 15, using your instructions. When I hit 3b, I get the following error:

      ./jre-6u26-linux-i586-rpm.bin: ./install.sfx.1796: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

      Poking around, I find that this error is usually associated with out of date applications, but that doesn’t seem to be the case here.

      I hate to ask anyone to help me debug my system online, but I’d appreciate any ideas you have.

      Reply
      • Hi Steve,

        Could you post following info:

        
        uname -a
        

        and

        
        ls -lt /lib/ld-linux*
        
        Reply
        • Here it is:
          [email protected] ~]$ uname -a
          Linux Fedora 2.6.38.8-32.fc15.x86_64 #1 SMP Mon Jun 13 19:49:05 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

          [[email protected] ~]$ ls -lt /lib/ld-linux*
          ls: cannot access /lib/ld-linux*: No such file or directory

          Thanks for the help

          Reply
          • Hi again Steve,

            Try to install 64-bit version of JRE, because you have 64-bit version of Fedora. So download x64 package, not i586. I think this should solve your problem, but please let me know, if you get it installed or have any other problems.

            Reply
            • THANK YOU!
              Worked like a charm. I think the problem was I got confused by the Oracle advice to install the 32-bit version. When I followed your instructions, everything Just Worked.

              Thanks again.
              Steve

              Reply
              • You’re welcome! Nice to hear that you get it working! :)

                Reply
            • Thanks JR, worked for me also.

              Reply
    4. I have fresh installed Fedora 14 with Firefox 3.6.10 and then installed jdk-6u26-linux-i586-rpm.bin in /usr/java dir. I have exactly issued alternatives –install commands for jdk 32-bits as in your guide.

      Output of alternatives –display libjavaplugin.so:

      libjavaplugin.so – status is auto.
      link currently points to /usr/java/jdk1.6.0_26/jre/lib/i386/libnpjp2.so
      /usr/lib/jvm/jre-1.6.0-openjdk/lib/i386/IcedTeaPlugin.so – priority 16000
      /usr/java/jdk1.6.0_26/jre/lib/i386/libnpjp2.so – priority 20000
      Current `best’ version is /usr/java/jdk1.6.0_26/jre/lib/i386/libnpjp2.so.

      But about:plugins does not show browser plugins.
      Waiting for your further guidance.

      DPP

      Reply
      • Hi DPP,

        This sounds SELinux problem, try run following:

        
        chcon -t execmem_exec_t '/usr/lib/firefox-3.6/firefox'
        
        Reply
        • Hi JR

          Your diagnosis has worked!!

          I appreciate your in depth knowledge in Linux.

          My come come back to you in future.

          Reply
          • Hi again DPP,

            Excellent! You’re always welcome back!

            Reply
            • I backed up the disk partition for Fedora 10 successfully using PING (Partimage Is Not Ghost). But PING can not backup the lvm2 partition for fedora 14. Can I backup Fedora 14 partition using Fedora 15 live CD or by any other disk partition backup utility?

              DPP

              Reply
    5. […] follow this Install Sun/Oracle Java JDK/JRE 6u27 on Fedora 15, CentOS/RHEL 5.6/6 and you get […]

      Reply
    6. Hello. I am a new user to Linux, and I use Fedora 15. I have followed your steps for the jre pack.

      I installed everything that’s necessary for it, but here is the problem.

      Firefox doesn’t pick it up. So, I went to firefox plugin directory, and found libjavaplugin.so and found out that the link is broken.

      I clicked on the file, and it said

      “This link cannot be used, because its target “/etc/alternatives/libjavaplugin.so” doesn’t exist.”

      So, I went there, and found out a file with the same name. And it in turn said.

      “This link cannot be used, because its target “/usr/java/jdk1.6.0_27/jre/lib/i386/libnpjp2.so” doesn’t exist”

      I went there is no –jdk1.6.0_27– Why is it happening so?

      Reply
      • Hi Jariski,

        So you tried to install JRE? Did you followed exactly just JRE part of guide or did you run some JDK commands?

        Reply
    7. […] Google Chrome Unstable Web Browser on Fedora 15 64-bit with 32-bit Flash and Oracle Java plugin […]

      Reply
    8. For the last instruction
      export JAVA_HOME=”/usr/java/jdk1.6.0_29″

      I need to edit the file every time I swap the jdk version? Any better way for this?

      Reply
      • Hi Glenn Lee Kian Giap,

        Could you first post output of following command:

        
        ls -la /usr/java
        
        Reply
        • the output is not related to jdk1.6.0_29 because I have wipe out the previous VM and re-install using a clean CentOS

          Let me demonstrate what I was confused by,

          I follow this guide to install jdk1.6.0_30, I did the following:
          chmod +x /path/to/file/jdk-6u30-linux-*-rpm.bin
          /path/to/binary/jdk-6u30-linux-*-rpm.bin
          alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_30/jre/bin/java 20000
          alternatives –install /usr/bin/javac javac /usr/java/jdk1.6.0_30/bin/javac 20000

          then, I follow your jdk 7 installation guide, I did the following:
          rpm -Uvh /path/to/binary/jdk-7u2-linux-i586.rpm
          alternatives –install /usr/bin/java java /usr/java/jdk1.7.0_02/jre/bin/java 20000
          alternatives –install /usr/bin/javac javac /usr/java/jdk1.7.0_02/bin/javac 20000

          After the installation, I didn’t export JAVA_HOME.

          then, I use alternatives to pick my java and javac version:

          # /usr/sbin/alternatives –config java

          There are 4 programs which provide ‘java’.

          Selection Command
          ———————————————–
          1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
          2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
          *+ 3 /usr/java/jdk1.6.0_30/jre/bin/java
          4 /usr/java/jdk1.7.0_02/jre/bin/java

          Enter to keep the current selection[+], or type selection number: 3

          # /usr/sbin/alternatives –config java

          There are 4 programs which provide ‘java’.

          Selection Command
          ———————————————–
          1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
          2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
          *+ 3 /usr/java/jdk1.6.0_30/jre/bin/java
          4 /usr/java/jdk1.7.0_02/jre/bin/java

          Enter to keep the current selection[+], or type selection number: 3

          # /usr/sbin/alternatives –config javac

          There are 2 programs which provide ‘javac’.

          Selection Command
          ———————————————–
          *+ 1 /usr/java/jdk1.6.0_30/bin/javac
          2 /usr/java/jdk1.7.0_02/bin/javac

          Enter to keep the current selection[+], or type selection number: 1

          then, I check my java and javac version:
          # java -version
          java version “1.7.0_02”
          Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
          Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)
          # javac -version
          javac 1.7.0_02

          Sorry, I am newbie, I want to clarify the purpose of the command “alternatives –config java”(or javac)

          and is the above return from command “java -version” and “javac -version” expected, I mean I have pick 1.6.0_30, but this 2 commands still give me 1.7.0_02

          ———————
          Between, I issue the command you requested, not sure whether it helps:

          # ls -la /usr/java
          total 32
          drwxr-xr-x 3 root root 4096 Dec 20 23:24 .
          drwxr-xr-x 16 root root 4096 Nov 18 05:41 ..
          lrwxrwxrwx 1 root root 16 Dec 20 18:30 default -> /usr/java/latest
          drwxr-xr-x 8 root root 4096 Dec 20 23:24 jdk1.7.0_02
          lrwxrwxrwx 1 root root 21 Dec 20 23:24 latest -> /usr/java/jdk1.7.0_02

          Thanks for your help !

          Reply
          • I read the result from
            ls -la /usr/java

            It seems like my jdk1.6.0_30 being removed by the installation process of jdk1.7.0_02

            I am very confuse now? I can’t keep both jdk at the same time?

            Reply
            • I assume that my jdk1.6.0_30 was removed by the installation of jdk1.7.0_02, so I execute the following command to swap jdk version to open jdk:

              # /usr/sbin/alternatives –config java

              There are 4 programs which provide ‘java’.

              Selection Command
              ———————————————–
              + 1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
              2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
              * 3 /usr/java/jdk1.6.0_30/jre/bin/java
              4 /usr/java/jdk1.7.0_02/jre/bin/java

              Enter to keep the current selection[+], or type selection number: 1

              # java -version
              java version “1.7.0_02”
              Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
              Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)

              But the result is still jdk1.7.0

              ?.?

              Reply
              • I found that this is because the /usr/bin/java is not pointing to /etc/alternatives/java, which is pointing to the jdk selected from “alternatives –config java”

                How can I solve this ?

                Reply
                • I redo the jdk 1.6 installation with clean CentOS
                  found that /usr/bin/java is pointing /etc/alternative/java

                  After I complete jdk 1.7 installation
                  /usr/bin/java pointing /usr/java/default/bin/java

                  So, the problem occur after installation of jdk 1.7
                  How should I solve it ? manage the symbolic link manually ?

                  Sorry for posting so many comment replies because I am keep trying to find the solution, and share all the findings.

                  Reply
    9. For step4a.
      “## java ##
      alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_29/jre/bin/java 20000″

      Will it be better if
      alternatives –install /etc/alternative/java java /usr/java/jdk1.6.0_29/jre/bin/java 20000”

      because originally the symbolic link is in this way
      /usr/bin/java -> /etc/alternative/java -> jdk_path

      Reply
      • Hi again Glenn,

        Why do you think that it would be?
        On alternatives system, the primary link for java must be /usr/bin/java

        Did you even try your own suggestion? :)

        Reply
        • Oops, sorry about that. I submitted a bit earlier while trying, I was confuse by the symbolic link that time.

          Reply
    10. Hi Glenn,

      If you want to run both Java JDK 6 and Java JDK 7 at the same time on CentOS, then do following:

      1. Install Java JDK 7

      2. Verify that your Java 7 JDK installation is working as it should be

      3. Download Java JDK 6 select this time .bin package (not rpm.bin).

      4. Make your jdk-6u30-linux-i586.bin file executable:

      
      chmod +x /path/to/jdk-6u30-linux-i586.bin
      

      5. Change directory to /opt and run .bin file:

      
      cd /opt
      
      /path/to/jdk-6u30-linux-i586.bin
      

      6. Check that jdk1.6.0_30 is on /opt directory:

      
      ls -la /opt
      

      7. Setup Java 6 JDK with alternatives install command:

      
      ## java ##
      alternatives --install /usr/bin/java java /opt/jdk1.6.0_30/jre/bin/java 20000
      ## javaws (32-bit only) ##
      alternatives --install /usr/bin/javaws javaws /opt/jdk1.6.0_30/jre/bin/javaws 20000
       
      ## Java Browser (Mozilla) Plugin 32-bit ##
      alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /opt/jdk1.6.0_30/jre/lib/i386/libnpjp2.so 20000
       
      ## Java Browser (Mozilla) Plugin 64-bit ##
      alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /opt/jdk1.6.0_30/jre/lib/amd64/libnpjp2.so 20000
       
      ## Install javac only if you installed JDK (Java Development Kit) package ##
      alternatives --install /usr/bin/javac javac /opt/jdk1.6.0_30/bin/javac 20000
      alternatives --install /usr/bin/jar jar /opt/jdk1.6.0_30/bin/jar 20000
      

      You are done!

      Then when you want change between Java 6 and Java 7 use simply alternatives –config command:

      
      alternatives --config java   # # or javac or javaws or libjavaplugin.so or jar
       
      There are 2 programs which provide 'java'.
       
        Selection    Command
      -----------------------------------------------
       + 1           /opt/jdk1.6.0_30/jre/bin/java
      *  2           /usr/java/jdk1.7.0_02/jre/bin/java
       
      Enter to keep the current selection[+], or type selection number: 
      

      And yes with alternatives system you can easily run multiple versions of Java, but with rpm package management you can install just one Java. So you can have all Java 6 versions installed from u1, u2…u30 and all Java 7 versions installed (u1,u2…), and then you could have same time have OpenJDK 6 and OpenJDK 7 installed and so on…no problem at all…

      I hope this clarifies this issue and help you use Java 6 and Java 7 at the same time … :)

      If you have some problems feel free to ask… ;)

      Reply
      • Thanks a lot of your help!

        Another issue is that (with or without installing jdk 1.6), after I have completed jdk 1.7 installation /usr/bin/java pointing /usr/java/default/bin/java which causes swapping jdk version using “alternatives –config java” doesn’t give the correct result when “java -version”. The reason behind is because /usr/bin/java need to point to /etc/alternative/java.

        Should I just re-create the symbolic link myself?

        Reply
        • Now I feel that the jdk1.6 rpm.bin file installation from official website is actually giving a correct installation, the problem is on jdk1.7

          Reply
          • Just the first I have to say that Java 7 installation do not have (at least currently) any problems, I have used exactly same method dozens of times. So if your /usr/bin/java is pointing to /usr/java/default/bin/java, then you have not followed my guide, because my guide does not even use /usr/java/default/bin/java anywhere?

            Please could you post output of following commands:

            
            ls -la /usr/bin/java
            
            ls -la /etc/alternatives/java
            
            ls -la /usr/java/
            
            ls -la /opt/
            
            alternatives --display java
            
            alternatives --config java
            
            Reply
    11. Hi JR, thank you for this blog, I couldnt get mine to work too, and was about to post a question, when I saw your answer to Raul, I am running KDE PLASMA on Fedora 16. It is the firewall issue, where you suggested this command chcon -t execmem_exec_t ‘/usr/lib64/firefox-3.6/firefox’

      only here is firefox 9 so needs to be changed to chcon -t execmem_exec_t ‘/usr/lib64/firefox/firefox’

      And this was also the issue
      *+ 1 /usr/java/jre1.6.0_22/lib/amd64/libnpjp2.so
      2 /usr/java/jdk1.6.0_30/jre/lib/amd64/libnpjp2.so

      Enter to keep the current selection[+], or type selection number: 2
      [[email protected] feodor]# alternatives –config libjavaplugin.so.x86_64

      There are 2 programs which provide ‘libjavaplugin.so.x86_64’.

      Selection Command
      ———————————————–
      * 1 /usr/java/jre1.6.0_22/lib/amd64/libnpjp2.so
      + 2 /usr/java/jdk1.6.0_30/jre/lib/amd64/libnpjp2.so

      I changed to number two, and everything was finally working, in Opera and FF

      Thank you again, without you I would go insane.

      Reply
      • Hi eurofalcon,

        You are welcome! Excellent to hear that you got it working! :)

        Reply
    12. […] it said it would likely cause the browser to crash. I followed the last set of instructions from: http://www.if-not-true-then-false.co…-red-hat-rhel/ – all their other instructions have been very helpful this is the appended section in […]

      Reply
    13. Very helpful. Worked perfectly to get the Java plugin running on Google Chrome on Fedora 16. (Chrome looks in the Firefox plugins dir automatically.) Thanks!

      Reply
    14. I’m using Fedora 16 and trying to install the 32-bit JRE and 32-bit FireFox. I have a 64-bit machine. I need 32-bit Firefox/JRE, because I need to use a SSL VPN web app that only supports 32-bit.

      I’ve got 32-bit firefox installed with no problems, and I followed your directions in installting 32-bit JRE (on my 64-bit machine). Everything seems to work – I see the plugins in firefox; however, when I run the java test at java.com, it doesn’t work. Any ideas what I may be doing wrong? Any way for me to diagnose this?

      Thanks! Great info, by the way!

      Reply
      • Hi Tom,

        How do you installed 32-bit Firefox?

        Reply
        • I added the repos for fedora 32-bit and was able to ‘yum install’ it.

          Reply
          • Hi again Tom,

            I tried this same style 32-bit Firefox & Java setup on 64-bit Fedora, but I have exactly same problem. Firefox shows Java plugin, but it won’t work. I also tested 32-bit Google Chrome and I can’t get 32-bit Java browser plugin work on 64-bit system with 32-bit browser.

            Reply
1 2 3 4 5

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close