Install Oracle Java 7u79/80 on Fedora 24/23, CentOS/RHEL 7.2/6.8/5.11 - Comment Page: 5

Please note: This guide still working normally if you want install Sun/Oracle Java 7, but if you want Java 8 version, then check Install Oracle Java JDK/JRE 8 on Fedora, CentOS/RHEL. This is guide, howto Install Sun/Oracle Java JDK and JRE 7 CPU (7u79) and PSU (7u80) on Fedora 24/23/22/21/20/19/18/17/16/15/14/13/12, CentOS 7.2/6.8/5.11, Red Hat (RHEL) 7.2/6.8/5.11. Read more, what is difference between CPU and PSU release. If you're looking instruction for Sun/Oracle Java JDK/JRE version 6 installation on Fedora 20/19/18, CentOS/Red Hat (RHEL) 6.5/5.10, please check this guide. [inttf_post_ad1] What's new in Sun/Oracle Java 7 VM Compressed 64-bit object...

267 comments on “Install Oracle Java 7u79/80 on Fedora 24/23, CentOS/RHEL 7.2/6.8/5.11 - Comment Page: 5

1 3 4 5 6 7 10
    1. Thanks very much for the post!

      Reply
      • Hi George,

        You can ignore those .pack file errors, all jar packages are unpacked successfully (without errors). .pack files are used by Java Web Start clients to retrieve and unpack JAR files for Java programs. So these errors doesn’t affect the JRE / JDK functionality when you install it using RPM package.

        But only rpm installation is not enough, you have to setup your new Java version also, so first install rpm, ignore .pack errors and then follow this guide.

        Reply
        • I have the exactly same problem. How can I ignore those .pack errors?
          when I try to do it again it says ” package jdk-2000:1.7.0_11-fcs.x86_64 is already installed” is the jdk completely installed?

          Thanks

          Reply
          • Hi Richard,

            Yes you have JDK package installed just normally, when you get “package jdk-2000:1.7.0_11-fcs.x86_64 is already installed”, and it’s completely installed even if you get those .pack file errors and then next steo is just setup java, javac, etc.

            Reply
          • Hi, Richard, just continue with the installation. This is not a real problem for you :)

            JR, thank you, mate!

            Reply
            • Well thanks a lot JR and George , it really works 100% now.

              Reply
    2. Hi,
      I slightly modified your alternatives approach as follows:

      alternatives –verbose –install /usr/bin/java java /usr/java/latest/jre/b$
      –slave /usr/bin/JAVA_HOME JAVA_HOME /usr/java/latest \
      –slave /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws \
      –slave /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/l$
      –slave /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /u$
      –slave /usr/bin/javac javac /usr/java/latest/bin/javac \
      –slave /usr/bin/jar jar /usr/java/latest/bin/jar

      Later on, I do
      export JAVA_HOME=/etc/alternatives/JAVA_HOME

      In this way, I limit inconsistency risks further.

      Thanks for your great blog.

      Reply
      • Hi Casier,

        This is nice alternatives approach, thanks for sharing!

        Reply
    3. Straightforward, Brilliant!

      Thanks

      Reply
      • Just one point to review…

        Now I noticed that Firefox plugin is not getting updated. Just like the screenshot you have posted. Installed revision 11 but the “Check libjavaplugin.so with restarting Mozilla…” is showing revision 10.

        In my environment I have similiar behavior: installed revision 11 but the Firefox about:plugins is showing previous version 05.

        Nevertheless, when running firefox as root the plugin is shown updated.

        Please help!
        TIA

        Reply
        • Hi Renato,

          Try following:

          
          ## 32-bit ##
          alternatives --config libjavaplugin.so
          
          ## 64-bit ##
          alternatives --config libjavaplugin.so.x86_64
          

          And then select right version and restart Firefox (or even log out and back in).

          Reply
          • Wow. You’ve got the point!

            With the recent revision 13 made available, I amended the procedure according to .13 and it is working perfectly.

            Thanks so much for your great help JR.

            Reply
            • Excellent! :)

              I updated this guide to Java 7u13 too. :) Btw. if you want stay up to date little bit easier then you can use “latest method” when you run alternatives –install, like following:

              
              ## Example JRE 64-bit ##
              alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/lib/amd64/libnpjp2.so 20000
              

              You can check where latest point on file system:

              
              ls -la /usr/bin/java
              
              Reply
              • Should that be “ls -la /usr/bin/java” ? (Running CentOS 6.4 64-bit)

                Reply
                • Hi Peter,

                  Yes it should :) I updated this comment, thanks!

                  Reply
    4. After struggling to do this for so long and confusing instructions for CENTOS 4/5, the instructions above are awesome. Thank you!

      Reply
    5. Question for you: I’ve been teaching myself java programming through the free online class that Stanford offers, but the sample lessons they provide require a 6 runtime enviroment. I found an rpm file of openjdk 6 but when I try to install it, it stops my since I already have openjdk7. How can I install these side by side?

      Reply
      • Hi Topher,

        You could try following command to install OpenJDK 6, when you have OpenJDK 7 installed:

        
        rpm --nodeps -ihv /path/to/java-1.6.0-openjdk-1.6.*.rpm
        
        Reply
        • Thanks! Worked like a charm!

          Reply
    6. Hi, at the first step, when i try to install i get this message :

      [[email protected] Downloads]# rpm -Uvh jdk-7u15-linux-x64.rpm
      Preparing… ################################# [100%]
      Updating / installing…
      1:jdk-2000:1.7.0_15-fcs ################################# [100%]
      Unpacking JAR files…
      rt.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/rt.pack
      jsse.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/jsse.pack
      charsets.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/charsets.pack
      tools.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_15/lib/tools.pack
      localedata.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_15/jre/lib/ext/localedata.pack

      What is the cause of this, i both tried to install jde and jdk but result is the same. Thank you very much for your guides.

      Reply
    7. I do not know what caused my problem but i removed all java versions with this command :

      yum remove *java*

      After that i rebooted my fedora 18 and followed the guide again with the new version of jre and jdk 1.7u15

      I hope this helps.

      Reply
      • Hi nightshift,

        You can ignore those .pack file errors, all jar packages are unpacked successfully (without errors). .pack files are used by Java Web Start clients to retrieve and unpack JAR files for Java programs. So these errors doesn’t affect the JRE / JDK functionality when you install it using RPM package.

        Reply
    8. This tutorial rock!

      Reply
    9. Hi JR,

      Thanks a lot you save my night!

      Reply
    10. Hi, I wish you could give a hand on this, my friend.
      After download java-re as you can see below, all I got is this output:

      cd Downloads/
      [[email protected] Downloads]# ls
      jre-7u15-linux-i586.rpm
      [[email protected] Downloads]# rpm -Uvh /path/to/binary/jre-7u15-linux-i586.rpm
      error: open of /path/to/binary/jre-7u15-linux-i586.rpm failed: No such file or directory
      [[email protected] Downloads]#

      I don’t what I’m overlooking, I’d appreciate any clue.
      Thanks.
      Txe

      Reply
      • Hi txe,

        /path/to/binary means path to jre-7u15-linux-*.rpm file, so if you are downloads path, then your path to binary is “empty” or ./

        Same command on your case:

        
        rpm -Uvh jre-7u15-linux-i586.rpm
        
        Reply
        • Hi JR,
          Thanks for your reply.
          Yes you are absolutely right, I should have been cloud (it was a hard long day.. sorry.) However I’m really lost now. The output I got when I type (being root) $rpm -Uvh jre-7u15-linux-i586.rpm is that the package is already installed ๏๏.

          So what I did was to carry on whit the rest of your guide. In my case:
          ## java ##
          alternatives --install /usr/bin/java java /usr/java/jre-1.7.0_15-fcs.i586/bin/java 20000

          ## javaws ##
          alternatives --install /usr/bin/javaws javaws /usr/java/jre-1.7.0_15-fcs.i586/bin/javaws 20000

          ## Java Browser (Mozilla) Plugin 32-bit ##
          alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jre-1.7.0_15-fcs.i586/lib/i386/libnpjp2.so 20000 Whit no reply from cli in any of these cases so I though it was going OK. However when I type java –version this is the output I got:

          [[email protected] Downloads]$ java --version
          bash: java: command not found...
          [[email protected] Downloads]$ which java
          /usr/bin/which: no java in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/txe/.local/bin:/home/txe/bin)
          [[email protected] Downloads]$

          Any help, please?, please..
          Txe.

          Reply
          • Probably I typed wrong again I said, I tried also this lines with, and still unsuccessful.

            alternatives –install /usr/bin/java java /usr/java/jre-1.7.0_15/bin/java 20000
            alternatives –install /usr/bin/javaws javaws /usr/java/jre-1.7.0_15/bin/javaws 20000
            alternatives –install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jre-1.7.0_15/lib/i386/libnpjp2.so 20000

            Txe

            Reply
            • Hi txe,

              Could you post output of following command:

              
              ls -la /usr/java
              
              Reply
              • Hi JR.
                Thanks for your reply
                This the output I got:

                [[email protected] ~]$ ls -la /usr/java
                total 12
                drwxr-xr-x. 3 root root 4096 Feb 27 23:52 .
                drwxr-xr-x. 13 root root 4096 Feb 27 23:52 ..
                lrwxrwxrwx. 1 root root 16 Feb 27 23:52 default -> /usr/java/latest
                drwxr-xr-x. 6 root root 4096 Feb 27 23:52 jre1.7.0_15
                lrwxrwxrwx. 1 root root 21 Feb 27 23:52 latest -> /usr/java/jre1.7.0_15
                [[email protected] ~]$

                Reply
                • Thanks, it looks good, could you then post output of following commands:

                  
                  alternatives --display java
                  
                  alternatives --display javaws
                  
                  alternatives --display libjavaplugin.so
                  

                  And then also output of following command:

                  
                  /usr/java/jre-1.7.0_15/bin/java --version
                  
                  Reply
                  • Hi JR,
                    Here it’s the output I got for each line, my friend:
                    Thanks.

                    [[email protected] ~]$ alternatives --display java
                    java - status is auto.
                    link currently points to /usr/java/latest/jre/bin/java
                    /usr/java/latest/jre/bin/java - priority 20000
                    slave keytool: (null)
                    slave orbd: (null)
                    slave pack200: (null)
                    slave rmid: (null)
                    slave rmiregistry: (null)
                    slave servertool: (null)
                    slave tnameserv: (null)
                    slave unpack200: (null)
                    slave jre_exports: (null)
                    slave jre: (null)
                    slave java.1.gz: (null)
                    slave keytool.1.gz: (null)
                    slave orbd.1.gz: (null)
                    slave pack200.1.gz: (null)
                    slave rmid.1.gz: (null)
                    slave rmiregistry.1.gz: (null)
                    slave servertool.1.gz: (null)
                    slave tnameserv.1.gz: (null)
                    slave unpack200.1.gz: (null)
                    /usr/java/jre-1.7.0_15-fcs.i586/bin/java - priority 20000
                    slave keytool: (null)
                    slave orbd: (null)
                    slave pack200: (null)
                    slave rmid: (null)
                    slave rmiregistry: (null)
                    slave servertool: (null)
                    slave tnameserv: (null)
                    slave unpack200: (null)
                    slave jre_exports: (null)
                    slave jre: (null)
                    slave java.1.gz: (null)
                    slave keytool.1.gz: (null)
                    slave orbd.1.gz: (null)
                    slave pack200.1.gz: (null)
                    slave rmid.1.gz: (null)
                    slave rmiregistry.1.gz: (null)
                    slave servertool.1.gz: (null)
                    slave tnameserv.1.gz: (null)
                    slave unpack200.1.gz: (null)
                    /usr/java/jre-1.7.0_15/bin/java - priority 20000
                    slave keytool: (null)
                    slave orbd: (null)
                    slave pack200: (null)
                    slave rmid: (null)
                    slave rmiregistry: (null)
                    slave servertool: (null)
                    slave tnameserv: (null)
                    slave unpack200: (null)
                    slave jre_exports: (null)
                    slave jre: (null)
                    slave java.1.gz: (null)
                    slave keytool.1.gz: (null)
                    slave orbd.1.gz: (null)
                    slave pack200.1.gz: (null)
                    slave rmid.1.gz: (null)
                    slave rmiregistry.1.gz: (null)
                    slave servertool.1.gz: (null)
                    slave tnameserv.1.gz: (null)
                    slave unpack200.1.gz: (null)
                    Current `best' version is /usr/java/latest/jre/bin/java.
                    [[email protected] ~]$
                    ------------------------
                    [[email protected] ~]$ alternatives --display javaws
                    javaws - status is auto.
                    link currently points to /usr/java/jre-1.7.0_15-fcs.i586/bin/javaws
                    /usr/java/jre-1.7.0_15-fcs.i586/bin/javaws - priority 20000
                    /usr/java/jre-1.7.0_15/bin/javaws - priority 20000
                    Current `best' version is /usr/java/jre-1.7.0_15-fcs.i586/bin/javaws.
                    [[email protected] ~]$
                    ---------------------
                    [[email protected] ~]$ alternatives --display libjavaplugin.so
                    libjavaplugin.so - status is auto.
                    link currently points to /usr/java/latest/jre/lib/i386/libnpjp2.so
                    /usr/java/latest/jre/lib/i386/libnpjp2.so - priority 20000
                    /usr/java/jdk1.7.0_15/jre/lib/i386/libnpjp2.so - priority 20000
                    /usr/java/jre-1.7.0_15-fcs.i586/lib/i386/libnpjp2.so - priority 20000
                    /usr/java/jre-1.7.0_15/lib/i386/libnpjp2.so - priority 20000
                    Current `best' version is /usr/java/latest/jre/lib/i386/libnpjp2.so.
                    [[email protected] ~]$
                    ----------------------
                    [[email protected] ~]$ /usr/java/jre-1.7.0_15/bin/java --version
                    bash: /usr/java/jre-1.7.0_15/bin/java: No such file or directory
                    [[email protected] ~]$

                    Reply
                    • Sorry, I wrote actually wrong path, could you also post output of following commands:

                      
                      /usr/java/jre1.7.0_15/bin/java --version
                      
                      /usr/java/latest/bin/java --version
                      
                      Reply
                      • Hi JR,
                        Sorry, I should have replied here for keeping the thread, isn’t?. But once done I could not reverse the posting process. So re-post it, here again. Sorry to the inconvenience.

                        [[email protected] ~]$ /usr/java/jre1.7.0_15/bin/java --version
                        Unrecognized option: --version
                        Error: Could not create the Java Virtual Machine.
                        Error: A fatal exception has occurred. Program will exit.
                        [[email protected] ~]$


                        [[email protected] ~]$ /usr/java/latest/bin/java --version
                        Unrecognized option: --version
                        Error: Could not create the Java Virtual Machine.
                        Error: A fatal exception has occurred. Program will exit.
                        [[email protected] ~]$

    11. You deserve to go to heaven for taking the time and effort to write this article for people you don’t even know. Your work is highly appreciated!

      Reply
    12. thanks for great support

      Reply
    13. Hi JR,
      Thanks again. Here both outputs:

      [[email protected] ~]$ /usr/java/jre1.7.0_15/bin/java --version
      Unrecognized option: --version
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.
      [[email protected] ~]$

      ------------------------

      [[email protected] ~]$ /usr/java/latest/bin/java --version
      Unrecognized option: --version
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.
      [[email protected] ~]$

      Reply
      • Let’s continue here, this discussion.

        First run following commands (remove your current linking):

        
        alternatives --remove java /usr/java/latest/jre/bin/java
        
        alternatives --remove java /usr/java/jre-1.7.0_15-fcs.i586/bin/java
        
        alternatives --remove java /usr/java/jre-1.7.0_15/bin/java
        
        alternatives --remove javaws /usr/java/jre-1.7.0_15-fcs.i586/bin/javaws
        
        alternatives --remove javaws /usr/java/jre-1.7.0_15/bin/javaws
        
        alternatives --remove libjavaplugin.so /usr/java/latest/jre/lib/i386/libnpjp2.so
        
        alternatives --remove libjavaplugin.so /usr/java/jdk1.7.0_15/jre/lib/i386/libnpjp2.so
        
        alternatives --remove libjavaplugin.so /usr/java/jre-1.7.0_15-fcs.i586/lib/i386/libnpjp2.so
        
        alternatives --remove libjavaplugin.so /usr/java/jre-1.7.0_15/lib/i386/libnpjp2.so
        

        Then install java, javaws and java plugin again:

        
        ## java ##
        alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000
         
        ## javaws ##
        alternatives --install /usr/bin/javaws javaws /usr/java/latest/bin/javaws 20000
         
        ## Java Browser (Mozilla) Plugin 32-bit ##
        alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/lib/i386/libnpjp2.so 20000
        

        Then try:

        
        java -version
        
        Reply
        • Hi JR,
          Thanks for your reply. This is the output I got now:

          [[email protected] txe]# java -version
          java version "1.7.0_15"
          Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
          Java HotSpot(TM) Server VM (build 23.7-b01, mixed mode)
          [[email protected] txe]#

          Then I checked out for plugins (about:plugins) on firefox and I can see them installed, though with a warning indication about using java on ff. (I hope it’s right thing using it..). Is there anything else I should do?
          I really appreciate your help.
          Txe.

          Reply
          • Hi txe,

            You got Java installed as it should be, but one thing to do now, is update installed Java JRE 7u15 to latest update 17, which fix Java browser plugin bug.

            Now when you use latest method, you can just download new package and install it using following command:

            
            rpm -Uvh /path/to/binary/jre-7u17-linux-i586.rpm
            

            Then you can check that it’s properly updated using following command:

            
            java -version
            

            And you can check browser plugin version on about:plugins page.

            Reply
            • Ah!. Ok. but don’t I have to uninstall the previous one version or something like that?
              Thanks!
              Txe.

              Reply
              • Hi txe,

                You can just update previous version with rpm -Uvh jre-7u17-linux-i586.rpm command, so you don’t have to uninstall it first.

                Reply
1 3 4 5 6 7 10

Leave a Reply to dac Cancel 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