Install Oracle Java JDK/JRE 7u67 on Fedora 20/19, CentOS/RHEL 7/6.5/5.10

java-logo
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 update 67 (7u67) on Fedora 20/19/18/17/16/15/14/13/12, CentOS 7/6.5/5.10, Red Hat (RHEL) 7/6.5/5.10.

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.

What’s new in Sun/Oracle Java 7

  • VM
    • Compressed 64-bit object pointers
    • Garbage-First GC (G1)
    • JSR 292: VM support for non-Java languages (InvokeDynamic)
  • Lang
    • JSR 294: Language and VM support for modular programming
    • JSR 308: Annotations on Java types
    • JSR TBD: Small language enhancements (Project Coin)
    • JSR TBD: Project Lambda
  • Core
    • Modularization (Project Jigsaw)
    • Upgrade class-loader architecture
    • Method to close a URLClassLoader
    • Unicode 5.1
    • Concurrency and collections updates (jsr166y)
    • JSR 203: More new I/O APIs for the Java platform (NIO.2)
    • SCTP (Stream Control Transmission Protocol)
    • SDP (Sockets Direct Protocol)
    • Elliptic-curve cryptography (ECC)
  • Client
    • XRender pipeline for Java 2D
    • Nimbus look-and-feel for Swing
    • Swing JLayer component
  • Web
    • Update the XML stack

Read full info from here.

Install Sun/Oracle Java JDK/JRE 7u67 on Fedora 20/19/18/17/16/15/14/13/12, CentOS 7/6.5/5.10, Red Hat (RHEL) 7/6.5/5.10

1. Download Sun/Oracle Java JDK/JRE 7u67 32-bit/64-bit RPM packages

Download Sun/Oracle Java 7u67 from here http://www.oracle.com/technetwork/java/javase/downloads/index.html. Select rpm package (jdk-7u67-linux-i586.rpm, jdk-7u67-linux-x64.rpm, jre-7u67-linux-i586.rpm or jre-7u67-linux-x64.rpm).

2. Change to root user.

sudo -i
## OR ##
su -

3. Install Java JDK or JRE package

## JDK 32-bit ##
rpm -Uvh /path/to/binary/jdk-7u67-linux-i586.rpm
 
## JDK 64-bit ##
rpm -Uvh /path/to/binary/jdk-7u67-linux-x64.rpm
 
## JRE 32-bit ##
rpm -Uvh /path/to/binary/jre-7u67-linux-i586.rpm
 
## JRE 64-bit ##
rpm -Uvh /path/to/binary/jre-7u67-linux-x64.rpm

4a. Install Sun/Oracle JDK java, javaws, libjavaplugin.so (for Firefox/Mozilla) and javac with alternatives –install command

Use Java JDK latest version (/usr/java/latest)

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

Use Java JDK absolute version (/usr/java/jdk1.7.0_67)

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

4b. Install Sun/Oracle JRE java, javaws and libjavaplugin.so (for Firefox/Mozilla) with alternatives –install command

Use Java JRE latest version (/usr/java/latest)

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

Use Java JRE absolute version (/usr/java/jre1.7.0_67)

## java ##
alternatives --install /usr/bin/java java /usr/java/jre1.7.0_67/bin/java 200000
 
## javaws ##
alternatives --install /usr/bin/javaws javaws /usr/java/jre1.7.0_67/bin/javaws 200000
 
## Java Browser (Mozilla) Plugin 32-bit ##
alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/jre1.7.0_67/lib/i386/libnpjp2.so 200000
 
## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/jre1.7.0_67/lib/amd64/libnpjp2.so 200000

5. Check current java, javac, javaws and libjavaplugin.so versions

java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
 
javaws
Java(TM) Web Start 10.51.2.13-fcs
[...]
 
javac -version
javac 1.7.0_67

Note: Check libjavaplugin.so with restarting Mozilla Firefox and writing about:plugins on address bar.
Java 7 Browser Plugin Fedora 18 Firefox 17

Java 7 console output on Fedora 18:
Java 7 on Fedora 18 Console Output

6. Swap between OpenJDK and Sun/Oracle Java JDK/JRE 6 and 7 versions

java

alternatives --config java
 
There are 5 programs which provide 'java'.
 
  Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/jre/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
 + 3           /usr/java/jdk1.6.0_26/jre/bin/java
   4           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   5           /usr/java/jdk1.7.0_67/jre/bin/java
 
Enter to keep the current selection[+], or type selection number: 5

Note: java with [+] is currently on use

javaws

alternatives --config javaws
 
There are 3 programs which provide 'javaws'.
 
  Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/jre/bin/javaws
 + 2           /usr/java/jdk1.6.0_26/jre/bin/javaws
   3           /usr/java/jdk1.7.0_67/jre/bin/javaws
 
Enter to keep the current selection[+], or type selection number: 3

Note: java with [+] is currently on use

libjavaplugin.so (32-bit)

alternatives --config libjavaplugin.so
 
There are 3 programs which provide 'libjavaplugin.so'.
 
  Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/jre/lib/i386/libnpjp2.so
 + 2           /usr/java/jdk1.6.0_26/jre/lib/i386/libnpjp2.so
   3           /usr/java/jdk1.7.0_67/jre/lib/i386/libnpjp2.so
 
Enter to keep the current selection[+], or type selection number: 3

libjavaplugin.so.x86_64 (64-bit)

alternatives --config libjavaplugin.so.x86_64
 
There are 3 programs which provide 'libjavaplugin.so.x86_64'.
 
  Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/jre/lib/amd64/libnpjp2.so
 + 2           /usr/java/jdk1.6.0_26/jre/lib/amd64/libnpjp2.so
   3           /usr/java/jdk1.7.0_67/jre/lib/amd64/libnpjp2.so
 
Enter to keep the current selection[+], or type selection number: 3

javac

alternatives --config javac
 
There are 3 programs which provide 'javac'.
 
  Selection    Command
-----------------------------------------------
*  1           /usr/java/jdk1.6.0_24/bin/javac
 + 2           /usr/java/jdk1.6.0_26/bin/javac
   3           /usr/java/jdk1.7.0_67/bin/javac
 
Enter to keep the current selection[+], or type selection number: 3

Note: java with [+] is currently on use

Post-Installation Setup

Add JAVA_HOME environment variable to /etc/profile file or $HOME/.bash_profile file

Java JDK and JRE latest version (/usr/java/latest)

## export JAVA_HOME JDK/JRE ##
export JAVA_HOME="/usr/java/latest"

Java JDK and JRE absolute version (/usr/java/jdk1.7.0_67)

## export JAVA_HOME JDK ##
export JAVA_HOME="/usr/java/jdk1.7.0_67"
 
## export JAVA_HOME JRE ##
export JAVA_HOME="/usr/java/jre1.7.0_67"
Follow If Not True Then False Updates!

243 Comments

  1. Hi,

    I was using this because I am trying to use the juniper vpn service. I am using fedora 19 with a 64bit firefox. Juniper VPN requires a 32bit jre.

    Is it possible to have 32bit jre and firefox plugin with a 64bit firefox?

  2. Thanks very much! This really saved me a lot of time!

  3. I was not really paying much attention at first and then really just snapped in and followed this post. I’m happy, nice that I don’t have to use that junk icedtea no more. Thanks a lot :)

  4. Thank you very much, you are great. Made my task a lot more easier to complete.

  5. Thank you for help — extremely helpful, detailed, and clear! Helped me on Scientific Linux 6.

  6. Just wanted to let everyone know, it also works with the newer Java 8. The steps are pretty much the same, only the names of the rpm packages have a different version number.

  7. i have centOS 6.5 64bit & java 1.5 default. when i installed jdk/jre 8 rpm, it gaves me like this :

    rpm -Uvh jdk-8u5-linux-x64.rpm
    error: open of failed: No such file or directory
    error: open of failed: No such file or directory
    error: open of Unauthorized failed: No such file or directory
    error: open of Request failed: No such file or directory
    error: open of <META failed: No such file or directory

    *root already

    please kindly help

    • Hi faharuru,

      Try to add full path to this command, like:

      rpm -Uvh /full/path/jdk-8u5-linux-x84.rpm
  8. I have already commented a huge post to this topic, but was deleted by admins.

    There is one general rule for centos/rhel/fedora. do NOT use Oracle rpms. If you really need elaborate with “upstream” blobs. Use *tarballs*. Theirs RPMS can actually harm your system.

    Once you have unpacked jdk fom tarball, then it is simple task to set up an alternatives. Currently Fedora have packed openjdk7 and 8. RRHEL have the same, + Openjdk6, oracle 6, 7 and all IBM’s javas.

    If there is any serious reson why those RPMS are not enough, please let me know. I can fix them.

    • Hi judovana,

      Your earlier comment is not deleted, but it was marked as spam (automatically) due to the multiple links.

      Have to say, that I haven’t see theirs RPMs causing any harm to systems, but you might be right. This is not guide, which Java to choose and why, this is guide howto install Oracle Java.

      I totally agree that, the OpenJDK is good choice and good alternative, but I have see many cases where only Oracle Java is working / working properly, especially on corporate environments.

      And yes you will need Oracle Java if you are developer and you have to make sure that your own app work with Oracle Java.

      The idea of this site is to share information and not directly blame or hate some app or organization.

  9. ty for the reply jr

    Still the same….
    FYI…. its on vps (if it helps), it’s already +x mode
    i’v tried on usuall pc it works.

    sudo rpm -Uvh /home/fahamin/jdk-8u5-linux-x64.rpm
    [sudo] password for fahamin:
    error: open of failed: No such file or directory
    error: open of failed: No such file or directory
    error: open of Unauthorized failed: No such file or directory
    error: open of Request failed: No such file or directory
    error: open of <META failed: No such file or directory

    ty

  10. my bad…
    i’v copy the url download link straight, but it’s only download the html.

    but now its OK. download on local pc 1st & copy the url link download to my vps.

    ty for your time jr

    • You are welcome and excellent to hear that you got it working.

  11. Thanks man, This help me to setup my VPS Java installation.

  12. You cannot ignore this. The JVM will not load/work correctly. When this happened to me I had an old, funky install of the rpm that I had to remove first. Once I was able to remove it, the install went smoothly.

  13. Hi,
    Thanks very much for the procedure, iv been trying to enable java on my fedora for a really long time, with no luck, i keep getting the same error “Error, Click for details”, i also followed your procedure with the same result, bellow are my info :

    alsaadi:/home/alsaadi #java -version
    java version “1.7.0_65″
    Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
    Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
    alsaadi:/home/alsaadi #javaws
    Java(TM) Web Start 10.65.2.17-fcs
    alsaadi:/home/alsaadi #uname -a
    Linux alsaadi 3.15.6-200.fc20.x86_64 #1 SMP Fri Jul 18 02:36:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

    Any idea how to fix this issue ?

  14. Hi rodmar, are you still having issues with juniper? All you have to do is put the 32 bit JRE somewhere on your computer, and this script will ask you where it is: https://github.com/jab416171/dotfiles/blob/master/bin/vpn
    This is what I use and it works great.

  15. Hi,
    Thanks very much for the procedure, iv been trying to enable java on my fedora for a really long time, with no luck, i keep getting the same error “Error, Click for details”, i also followed your procedure with the same result, bellow are my info :

    alsaadi:/home/alsaadi #java -version
    java version “1.7.0_65″
    Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
    Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
    alsaadi:/home/alsaadi #javaws
    Java(TM) Web Start 10.65.2.17-fcs
    alsaadi:/home/alsaadi #uname -a
    Linux alsaadi 3.15.6-200.fc20.x86_64 #1 SMP Fri Jul 18 02:36:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

    Any idea how to fix this issue ?

    • Hi Ahmed,

      So you get this error when you start “something” with Web Start?

      What details shows?

  16. thanks a lot

Leave a Comment

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks/Pingbacks

  1. Install Sun/Oracle Java JDK/JRE 7 (b108) on Fedora 13/CentOS 5.5 … | java - [...] więcej: Install Sun/Oracle Java JDK/JRE 7 (b108) on Fedora 13/CentOS 5.5 … fedora, jre, main, main-guide, rhel, …
  2. Install Sun/Oracle Java JDK/JRE 6u26 on Fedora 15, CentOS/RHEL 5.6/6 - [...] Install Sun/Oracle Java JDK/JRE 6u26 on Fedora 15, CentOS/RHEL 5.6/6By JR – Published: July 29, 2010 – Last Updated: …
  3. Android SDK r12 and Eclipse ADT on Fedora 15/14, CentOS/Red Hat (RHEL) 6 - [...] 1.1 Install Sun/Oracle Java 7 JDK/JRE [...]
  4. Create Full Screen Graphic Displayer - Page 2 - [...] used to barrel ahead willy nilly People say I'm not doing my work I'm sorry but I found this …
  5. NetBeans 7.0.1 / 7.1 RC1 on Fedora 16/15, CentOS/RHEL 6/5.7 - [...] Sun’s Java, because I think NetBeans works faster with Sun’s Java. Here is the guide, howto install Sun/Oracle Java …
  6. Installing Java on CentOS 6 and configuring it to use for PHPStrom | Simple Coder - [...] http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-ha... [...]
  7. java working but not in firefox - [...] again. I found this very useful when I set up my java, complete with an alternatives chooser: http://www.if-not-true-then-false.co...-red-hat-rhel/ -- …
  8. How do I install Java on CentOS 6.2? - [...] you want to install JRE on CentOS, follow the steps in this link. I have used this in the …
  9. Install Oracle Java JDK/JRE 8u5 on Fedora 20/19, CentOS/RHEL 6.5/5.10 - […] you’re looking installation instruction for older Oracle Java versions, then check Install Sun/Oracle Java JDK/JRE 7 on Fedora 20/19/18, …