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

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: 4

1 2 3 4 5 6 10
    1. Glad I found your guide (I plan to try it soon)… excellent attention to detail!

      Question 1: I plan to install JDK 7u5, so will guide work (assuming I replace ‘7u4’ with ‘7u5’ in the relevant commands)?

      Question 2: Do I need to perform the steps described in BOTH “Use Java JDK latest version (/usr/java/latest)” *AND* “Use Java JDK absolute version (/usr/java/jdk1.7.0_04)”?

      Question 3: In reference to “Use Java JDK absolute version (/usr/java/jdk1.7.0_04)”, will the “jdk1.7.0_04” number change if I’m installing JDK 7u5?

      Thanks, JR!

      Reply
      • Hi r0b0ty,

        I just updated this guide so answer for your first and third question found from guide and just select latest or absolute method. I strongly recommend latest method, so then later updates are very much easier… :)

        Reply
        • It has been going perfectly well… I’m on Step 6. “Swap between OpenJDK and Sun/Oracle Java JDK/JRE 6 and 7 versions” but I don’t see the “/usr/java/jdk1.7.0_05/jre/bin/java” selection… only this:

          “There are 2 programs which provide ‘java’.

          Selection Command
          ———————————————–
          1 /usr/lib/jvm/jre-1.7.0-openjdk/bin/java
          *+ 2 /usr/java/latest/jre/bin/java”

          I installed jdk-7u5-linux-i586.rpm, however (and yes, I know it includes JRE)… Is this a problem?

          I’m sure it has to do with Step 4a, where I chose to use the “latest” method. Does the …/latest/… directory really point to “/usr/java/jdk1.7.0_05/” directory, or something?

          Reply
          • It is exactly correct way to use /usr/java/latest/jre/bin/java and you should not see that /usr/java/jdk1.7.0_05/ directory, when you use latest. :) Latest is just link to always latest Java dirctory.

            You can check your java version, with following command:

            
            java -version
            

            Should be:
            java version "1.7.0_05"
            ...

            Reply
            • That’s what I suspected. So I can say that your guide worked perfectly for me. Thank you very much for your effort!

              Reply
              • Nice to hear! You are very welcome!

                Reply
    2. Hi, I need to run a program that need JVM, I folowed your instructios but when I run my program it show me the same error.
      Error occurred during initialization of VM
      Could not reserve enough space for object heap
      Could not create the Java virtual machine.

      My program is for my theses so I need help for install JVM, please help me.
      My program is Apollo: http://apollo.berkeleybop.org/current/index.html

      Reply
      • Ah, I used the lastedt version and doesn’t work and then I used the absolute version and doesn’t work, I don’t have javaws and javac, but I suppouse that I don’t need those for nunning my program.

        Reply
    3. Hi,

      Thank you for your kind effort, but I’m afraid, your instrutions are misleading already. When I install strictly according to the ORACLE’s instructions:
      ———————–
      .
      .
      .
      Linux

      JDK 7 Installation on Linux Platforms – both 32-bit and 64-bit, including RPM
      JRE 7 Installation on Linux Platforms – both 32-bit and 64-bit, including RPM

      In order to run Java applets within a browser, you must install the JRE plugin manually. Instructions for that process are available here:

      Manual Plugin Installation for Linux
      .
      .
      .
      ———————–
      evrything works fine, no need for different instructions. Apart from that, there seems to be a mistake in your instruction:
      it is
      /usr/java/latest/…
      rather than
      /usr/java/latest/jre/…

      also

      cd /usr/lib64/mozilla/plugins
      ln -s /usr/java/latest/lib/amd64/libnpjp2.so .
      rather than
      ln -s /usr/java/latest/lib/amd64/libnpjp2.so libjavaplugin.so

      Reply
      • Hi Anatoly,

        Thanks for this info, I will recheck this guide soon and fix this guide if there is something wrong… :)

        Did you noticed that the JRE part uses /usr/java/latest/ and JDK part uses /usr/java/latest/jre/?

        Reply
        • Hi again Anatoly,

          This guide works normally for me, and Java plugin works normally with clean installed system on Firefox and Google Chrome using alternatives command.

          And also paths /usr/java/latest/ for JRE and /usr/java/latest/jre/ for JDK works just right?

          Reply
          • Hi JR,

            Thank you for the re-check. You must be right.

            Cheers

            Reply
    4. updated version, but my google chrome is still pointing my java needs to be updated, somebody is having the same problem?

      Reply
      • Hi jean,

        Could you post output of following command:

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

        Did you remember start all browser instances after Java upgrade?

        Reply
        • Yes i rebooted system, after upgrade Java.
          alternatives –config libjavaplugin.so.x86_64
          Há 3 programas que oferecem “libjavaplugin.so.x86_64″.
          Seleção Comando
          ———————————————–
          1 /usr/lib64/IcedTeaPlugin.so
          2 /usr/lib/jvm/jre-1.7.0u04-sun-x64/lib/amd64/libnpjp2.so
          *+ 3 /usr/java/latest/lib/amd64/libnpjp2.so

          Reply
    5. Yes i rebooted system, after upgrade Java.

      alternatives –config libjavaplugin.so.x86_64

      Há 3 programas que oferecem “libjavaplugin.so.x86_64”.

      Seleção Comando
      ———————————————–
      1 /usr/lib64/IcedTeaPlugin.so
      2 /usr/lib/jvm/jre-1.7.0u04-sun-x64/lib/amd64/libnpjp2.so
      *+ 3 /usr/java/latest/lib/amd64/libnpjp2.so

      Reply
      • Thanks, could you also post output of following command:

        
        ls -la /usr/java
        
        Reply
        • ls -la /usr/java
          total 12
          drwxr-xr-x. 3 root root 4096 Ago 22 23:42 .
          drwxr-xr-x. 14 root root 4096 Ago 10 00:12 ..
          lrwxrwxrwx. 1 root root 16 Ago 22 23:38 default -> /usr/java/latest
          drwxr-xr-x. 6 root root 4096 Ago 22 23:38 jre1.7.0_06
          lrwxrwxrwx. 1 root root 21 Ago 22 23:38 latest -> /usr/java/jre1.7.0_06

          Reply
          • Everything looks good so far.

            Could you tell more specific what kind of error you get on Google Chrome, do get this error just some site(s) or always when you use Google Chrome?

            Which Java plugin you see, if you go to chrome://plugins/ ?

            Reply
            • When I enter the page chrome :/ / plugins shows that you need a security update, but I already have the latest update of java, I still do not understand why asking an update.
              I take a printscreen of the screen.

              http://postimage.org/image/gr3ogu8tx/

              Reply
              • What version of Google Chrome you are using?

                Go to: chrome://version

                Reply
                • Google Chrome 21.0.1180.81 (Versão oficial 151980)
                  SO Linux
                  WebKit 537.1 (@125733)
                  JavaScript V8 3.11.10.18
                  Flash 11.3.31.230

                  Reply
                  • Hi jean,

                    Your browser and Java plugin looks good.

                    That’s why I searched more information about this problem and I found out that this is Google Chrome bug, check this discussion and bug report.

                    Currently you can only wait next Google Chrome version and hopefully this problem is fixed then.

                    You can try following as a temporary fix to the problem. Start Google Chrome with following parameter and then you should get rid of this message:

                    
                    google-chrome --allow-outdated-plugins
                    
                    Reply
                    • ok, i will use the parameters while the version is not corrected.
                      Thank you for a search and discover the bug.

                      Reply
                      • You are welcome!

    6. Hi JR,

      i’m new to linux, i don’t know how to instal Java JDK,
      when i follow your instruction number 3, there is some error :

      rpm -Uvh /path/to/binary/jdk-7u7-linux-x64.rpm
      error: open of /path/to/binary/jdk-7u7-linux-x64.rpm failed: No such file or directory

      and then i try to follow the oracle java se documentation installation guide, and there is also have some error :

      the rpm -ivh jdk-7u7-linux-x64.rpm
      Preparing… ########################################### [100%]
      1:jdk ########################################### [100%]
      Unpacking JAR files…
      rt.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/rt.pack
      jsse.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/jsse.pack
      charsets.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/charsets.pack
      tools.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_07/lib/tools.pack
      localedata.jar…
      Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/ext/localedata.pack

      please help me to resolved this error. thank you

      Reply
      • Hi afr,

        On my guide /path/to/binary/ means path (directory) where you downloaded rpm package. Real world path (dir) could be something like /home/afr/Downloads, if your username is afr.

        Did you run this rpm command as root user?

        Reply
        • Thank you very much JR, your guide worked for me.

          Reply
          • You are welcome. Excellent to hear that you got it working!

            And welcome to Linux world, if you have some other Linux questions, feel free to ask :)

            Reply
      • Hi RFederer,

        java.com site is aimed primarily to ordinary Java users who just want/need Java JRE (Java Runtime Environment) version, like browser plug-in and the ability to run Java applications. And oracle.com site is aimed primarily Java developers who develop Java programs, compile Java code and of course run Java programs. I use Oracle site here, because you can download both versions JDK (Java Development Kit) and JRE (Java Runtime Environment) from there.

        Btw. Java is Oracle product and java.com is Oracle’s site, if you look just JRE version then you can use of course java.com.

        If you download JRE package from java.com and oracle.com and compare md5sum’s, you see that those are exactly same, because it’s just same file. :)

        
        ## 32-bit JRE from java.com ##
        9c45f8adf9f235105c74347e0d6b2b2e  jre-7u7-linux-i586.rpm
        
        ## 32-bit JRE from orcle.com ##
        9c45f8adf9f235105c74347e0d6b2b2e  jre-7u7-linux-i586.rpm
        

        Btw. I link to http://www.oracle.com/technetwork/java/javase/downloads/index.html not directly to JDK download page (http://www.oracle.com/technetwork/java/javase/downloads/jdk7u7-downloads-1836413.html. :)

        Reply
    7. Is the x86_64 rpm package of the latest java corrupt? I can’t extract it..

      Reply
      • Hi Sigg3,

        What error messages you get when you try extract it? Did you tried extract JDK or JRE?

        Reply
        • The JRE. I get this:
          # rpm -Uvh "jre-7u7-linux-x64(2).rpm"
          Preparing... ########################################### [100%]
          1:jre ########################################### [100%]
          Unpacking JAR files...
          rt.jar...
          Error: Could not open input file: /usr/java/jre1.7.0_07/lib/rt.pack
          jsse.jar...
          Error: Could not open input file: /usr/java/jre1.7.0_07/lib/jsse.pack
          charsets.jar...
          Error: Could not open input file: /usr/java/jre1.7.0_07/lib/charsets.pack
          localedata.jar...
          Error: Could not open input file: /usr/java/jre1.7.0_07/lib/ext/localedata.pack

          Reply
          • Hi Sigg3,

            I see what you mean, actually you can ignore those .pack file errors, all jar packages are unpacked successfully (without errors). .pack 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
            • You are right, I am now running the latest jre from oracle! Thanks!

              Reply
    8. Why the ‘20000’ parameter is needed in the alternate command? e.g. alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000

      Is it better to use the latest version or the absolute one when creating the symlinks?

      Reply
      • Hi Simo,

        20000 parameter is priority and it’s mandatory.

        
        usage: alternatives --install    
                            [--initscript ]
                            [--slave   ]*
               alternatives --remove  
               alternatives --auto 
               alternatives --config 
               alternatives --display 
               alternatives --set  
        
        ...
        
        Each alternative has a priority associated with it.  When a link  group
        is  in  automatic  mode,  the alternatives pointed to by members of the
        group will be those which have the highest priority.
        

        Latest version is better, if you don’t have any particular reason to run just exact version of Java.

        Reply
    9. I am getting this error in the second step!


      error: open of /path/to/binary/jdk-7u7-linux-x64.rpm failed: No such file or directory

      Why am I having problems installing everything on Fedora? :(

      Reply
      • This is just example path, you have to use right path, where you downloaded jdk-7u7-linux-x64.rpm file. Normally it’s under your your user Downloads directory if you do not changed download location.

        Reply
    10. How can I remove openjdk after that? Issuing “yum remove openjdk” wants to remove openjdk with tons of other useful softwares

      Reply
      • Hi Nirjhor,

        Do you need free disk space or why you want to remove OpenJDK?

        Reply
    11. Could you please give me some tip – why do I get that errors?

      Unpacking JAR files…
      rt.jar…
      Error: Could not open input file: /usr/java/jre1.7.0_09/lib/rt.pack
      jsse.jar…
      Error: Could not open input file: /usr/java/jre1.7.0_09/lib/jsse.pack
      charsets.jar…
      Error: Could not open input file: /usr/java/jre1.7.0_09/lib/charsets.pack
      localedata.jar…
      Error: Could not open input file: /usr/java/jre1.7.0_09/lib/ext/localedata.pack
      plugin.jar…
      Error: Could not open input file: /usr/java/jre1.7.0_09/lib/plugin.pack
      javaws.jar…
      Error: Could not open input file: /usr/java/jre1.7.0_09/lib/javaws.pack
      deploy.jar…
      Error: Could not open input file: /usr/java/jre1.7.0_09/lib/deploy.pack

      Reply
      • Hi Gizmo,

        you can ignore those .pack file errors, all jar packages are unpacked successfully (without errors). .pack 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
    12. Hi,

      Javaws not found on my system:

      # javaws
      bash: javaws: command not found…

      Here my outputs from the ls commands:

      #ls -la /usr/bin/java
      lrwxrwxrwx. 1 root root 22 Nov 28 20:53 /usr/bin/java -> /etc/alternatives/java

      #ls -la /etc/alternatives/java
      lrwxrwxrwx. 1 root root 34 Nov 28 20:53 /etc/alternatives/java -> /usr/java/jdk1.7.0_09/jre/bin/java

      # ls -la /usr/java/latest/jre/bin/java
      -rwxr-xr-x. 1 root root 7750 Set 25 00:43 /usr/java/latest/jre/bin/java

      #ls -la /usr/java/latest/bin/java
      -rwxr-xr-x. 1 root root 7750 Set 25 00:43 /usr/java/latest/bin/java

      #ls -la /usr/java/
      total 16
      drwxr-xr-x. 4 root root 4096 Nov 28 21:12 .
      drwxr-xr-x. 14 root root 4096 Set 25 00:39 ..
      lrwxrwxrwx. 1 root root 16 Nov 28 19:49 default -> /usr/java/latest
      drwxr-xr-x. 10 root root 4096 Nov 28 19:49 jdk1.7.0_09
      drwxr-xr-x. 6 root root 4096 Nov 28 21:12 jre1.7.0_09
      lrwxrwxrwx. 1 root root 21 Nov 28 19:49 latest -> /usr/java/jdk1.7.0_09

      # env |grep -i -e java -e path
      PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
      PWD=/usr/java/jdk1.7.0_09/jre/bin
      JAVA_HOME=/usr/java/jre1.7.0._09

      Tks in advance

      Reply
      • Hi crossfire,

        Run following as root:

        
        updatedb
        

        Then post output of following command:

        
        locate javaws
        
        Reply
        • [[email protected]|\|714L_7|-|R347 /]# locate javaws
          /home/user/.kde/share/apps/RecentDocuments/javaws.itweb.desktop
          /home/user/.local/share/applications/javaws.itweb.desktop
          /usr/bin/javaws
          /usr/bin/javaws.itweb
          /usr/java/jdk1.7.0_10/bin/javaws
          /usr/java/jdk1.7.0_10/jre/bin/javaws
          /usr/java/jdk1.7.0_10/jre/lib/javaws.jar
          /usr/java/jdk1.7.0_10/jre/lib/desktop/applications/sun-javaws.desktop
          /usr/java/jdk1.7.0_10/jre/lib/desktop/icons/HighContrast/16×16/apps/sun-javaws.png
          /usr/java/jdk1.7.0_10/jre/lib/desktop/icons/HighContrast/48×48/apps/sun-javaws.png
          /usr/java/jdk1.7.0_10/jre/lib/desktop/icons/HighContrastInverse/16×16/apps/sun-javaws.png
          /usr/java/jdk1.7.0_10/jre/lib/desktop/icons/HighContrastInverse/48×48/apps/sun-javaws.png
          /usr/java/jdk1.7.0_10/jre/lib/desktop/icons/LowContrast/16×16/apps/sun-javaws.png
          /usr/java/jdk1.7.0_10/jre/lib/desktop/icons/LowContrast/48×48/apps/sun-javaws.png
          /usr/java/jdk1.7.0_10/jre/lib/desktop/icons/hicolor/16×16/apps/sun-javaws.png
          /usr/java/jdk1.7.0_10/jre/lib/desktop/icons/hicolor/48×48/apps/sun-javaws.png
          /usr/java/jdk1.7.0_10/jre/lib/security/javaws.policy
          /usr/java/jdk1.7.0_10/man/ja_JP.UTF-8/man1/javaws.1
          /usr/java/jdk1.7.0_10/man/man1/javaws.1
          /usr/java/jre1.7.0_10/bin/javaws
          /usr/java/jre1.7.0_10/lib/javaws.jar
          /usr/java/jre1.7.0_10/lib/desktop/applications/sun-javaws.desktop
          /usr/java/jre1.7.0_10/lib/desktop/icons/HighContrast/16×16/apps/sun-javaws.png
          /usr/java/jre1.7.0_10/lib/desktop/icons/HighContrast/48×48/apps/sun-javaws.png
          /usr/java/jre1.7.0_10/lib/desktop/icons/HighContrastInverse/16×16/apps/sun-javaws.png
          /usr/java/jre1.7.0_10/lib/desktop/icons/HighContrastInverse/48×48/apps/sun-javaws.png
          /usr/java/jre1.7.0_10/lib/desktop/icons/LowContrast/16×16/apps/sun-javaws.png
          /usr/java/jre1.7.0_10/lib/desktop/icons/LowContrast/48×48/apps/sun-javaws.png
          /usr/java/jre1.7.0_10/lib/desktop/icons/hicolor/16×16/apps/sun-javaws.png
          /usr/java/jre1.7.0_10/lib/desktop/icons/hicolor/48×48/apps/sun-javaws.png
          /usr/java/jre1.7.0_10/lib/security/javaws.policy
          /usr/java/jre1.7.0_10/man/ja_JP.UTF-8/man1/javaws.1
          /usr/java/jre1.7.0_10/man/man1/javaws.1
          /usr/share/applications/javaws.desktop
          /usr/share/bash-completion/completions/javaws
          /usr/share/man/man1/javaws-itweb.1.gz
          /usr/share/pixmaps/javaws.png
          /var/lib/alternatives/javaws

          Reply
    13. Awesome thread and I very much needed your help. I followed your instructions and when I ran the code java -version it gave me an error telling me that the command does not exist. I troubleshooted and the issue I found is that the JRE folder is missing under usr/java/latest folder. And no matter how many times I run these commands:

      alternatives –install /usr/bin/java java /usr/java/latest/jre/bin/java 20000
      alternatives –install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000

      It still will not create the folders thus I believe the cause of the Java command not found issue. Could you please help? I would appreciate any reply:

      Reply
      • Hi mervs,

        Actually alternatives –install commands doesn’t create folders, it just create symbolic links. Could you post output of following commands:

        
        rpm -qa jre\* jdk\*
        
        ls -la /usr/java
        
        ls -la /usr/java/jre*
        
        ls -la /usr/java/jdk*
        
        Reply
    14. Amazing post guys! Very useful !

      Reply
1 2 3 4 5 6 10

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