Install Sun/Oracle Java JDK/JRE 6u45 on Fedora 19/18, CentOS/RHEL 6.4/5.9

java-logo
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 have to compile with Sun/Oracle Java or a particular program does not work without Sun/Oracle Java.

This is guide, howto install Oracle Java JDK/JRE 6u45 on Fedora 19/18/17/16/15/14/13/12, CentOS/RHEL 6.4/6.3/6.2/6.1/6/5.9.

Install Sun/Oracle Java JDK/JRE 6u45 on Fedora 19/18/17/16/15/14/13/12 CentOS 6.4/6.3/6.2/6.1/6/5.9, Red Hat (RHEL) 6.4/6.3/6.2/6.1/6/5.9

1. Download Sun/Oracle Java JDK or JRE RPMs

Download Sun/Oracle Java JDK or JRE from here (current version is JDK 6 Update 45) http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR.
Note: Select rpm.bin package (example jdk-6u45-linux-i586-rpm.bin, jre-6u45-linux-i586-rpm.bin, jdk-6u45-linux-x64-rpm.bin or jre-6u45-linux-x64-rpm.bin).

2. Change to root user.

3a. Run Sun/Oracle Java JDK binary

Note: Use full file name (without asterix) if you have both i586 and x64 versions downloaded.

3b. Run Sun/Oracle Java JRE binary

Note: Use full file name (without asterix) if you have both i586 and x64 versions downloaded.

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

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

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

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

Java 6 Console output on Fedora 18:
Fedora 18 Java 6 Console Output

6. Swap between OpenJDK and Sun/Oracle JDK versions

Note: java with [+] is currently on use

Post-Installation Setup

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

Share this post

127 Comments

  1. I have to say is be very careful when doing step 4, esp when dealing with symoblic links.
    For example in

    Make sure that the path

    really exist before hitting the enter key.
    In some java installations I have seen, the path can become

    (ie: without the jre).
    make sure you check your file system before making symbolic link, because once a syombolic link is establish, there is no turning back.

    Reply
    • Hi chen,

      Of course can turn back… :) Just remove wrong symbolic link using alternatives –remove … command (or using rm -f … command)… :)

      Reply
  2. This tutorial worked great on my Fedora 17, 64bit machine using the latest JDK. I can pass the Java test page without a problem.

    I am having a problem however opening any .jnlp files for example the Java consoles for IPMI and Spider KVMs. Since this 64bit rpm and this guide does not include javaws for 64bit machines, how will I be able to launch the .jnlp files?

    Thanks in advance

    Reply
    • Hi gnunix,

      Excellent to hear that you got Java working!

      I actually just checked this 6u33 package and looks like javaws is currently also included on 64-bit package so you can use it normally with 64-bit system, check javaws:

      Configure javaws:

      I updated this guide too. :)

      Reply
      • Thank you for your update JR. Now it works flawlessly. :)

        Reply
  3. Where do I find the rpm.bin files? When I go to Oracle’s Java downloads page I only see .rpm and .tgz.

    Thanx.

    Reply
    • I meant to say that I only see .rpm and .tar.gz on the Oracle download page.

      Reply
      • Hi Dean,

        If you are installing Java 7, then check Java 7 install guide and use .rpm packages, but if you want to install Java 6, then scroll down on Oracle download page and find Java 6 packages, which are rpm.bin.

        Reply
  4. Hi,
    i am using Redhat 5.3 EL 64 bit, firefox 17.0.1 64bit, java jre6u38 64 bit. I have done all above steps but still ‘about:plugins’ not showing java plugins.

    #alternatives –display libjavaplugin.so.x86_64
    libjavaplugin.so.x86_64 – status is auto.
    link currently points to /usr/java/jre.1.6.0_38/lib/amd64/libnpjp2.so
    /usr/java/jre1.6.0_38/lib/amd64/libnpjp2.so – priority 20000
    current ‘best’ version is /usr/java/jre1.6.0_38/lib/amd64/libnpjp2.so.

    also trying to execute
    #chcon -t execmem_exec_t ‘/usr/lib64/firfox-17.0.1/firefox’
    chcon: failed to change context of /usr/lib64/firefox-17.0.1/firefox to system_u:
    object_r:execmem_exec_t: Invalid argument

    Reply
    • Hi Rais,

      How did you installed your Firefox 17.0.1? Is Java plugin working if you try it with RHEL default Firefox?

      Reply
  5. i extract tar package and deleted all files of old firefox-3.0.5 in /usr/lib64/firefox-3.0.5/ and copy firfox 17 files in firefox-3.0.5 folder
    Note: i dont change or replace firefox 3.0.5 folder i just replace files.

    Reply
  6. yes firefox 3.0.5 shows java plugins in about:plugins folder but when i open java supported website firefox crash and when i remove java symlink then firefox does not crash.

    Reply
    • Hi Rais,

      Your install method sounds risky, if you have Firefox 3.0.5 installed from RHEL original RPMs. I recommend you to upgrade your RHEL to version 5.8 and you should get Firefox 10 RHEL patched version or alternatively install and test Firefox 17 on your user home dir and try Java plugin with it.

      Reply
  7. thanks for your reply, i have downloaded RHEL 5.8 64 bit but when i install it python-ldap missing and installation end, can you give me a link for RHEL 5.8 64 bit ?
    hey you say upgrade can you tell me how can i upgrage 5.3 to 5.8 ?

    Reply
    • You can download RHEL 5.8 from RHEL Download page.

      Upgrade you can actually do simple using following command:

      If you have some important data on your system, then I recommend you to backup everything important before upgrade.

      Reply
  8. Hello, I just dropped by to look at this blog. It appears really
    great and I had a good time browsing it, thank you very much for the helpful article!

    Reply
  9. chrome install-6U23 what is it & uses in laptops….

    Reply

Trackbacks/Pingbacks

  1. Install Google Chrome with YUM on Fedora 16/15, CentOS/Red Hat (RHEL) 6 - [...] Google Chrome Unstable Web Browser on Fedora 15 64-bit with 32-bit Flash and Oracle Java plugin [...]
  2. 2 days of utter frustration trying to have java plugins seen by Firefox9 - [...] 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/ …

Submit 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 class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">