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...
Thanks very much for the post!
Hi, thanks for helpful lessons but here I got an error: http://i45.tinypic.com/6ql9g5.png
So what I can do and install this java package?
Best regards,
George!
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.
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
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.
Hi, Richard, just continue with the installation. This is not a real problem for you :)
JR, thank you, mate!
Well thanks a lot JR and George , it really works 100% now.
Excellent! :)
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.
Hi Casier,
This is nice alternatives approach, thanks for sharing!
Straightforward, Brilliant!
Thanks
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
Hi Renato,
Try following:
And then select right version and restart Firefox (or even log out and back in).
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.
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:
You can check where latest point on file system:
Should that be “ls -la /usr/bin/java” ? (Running CentOS 6.4 64-bit)
Hi Peter,
Yes it should :) I updated this comment, thanks!
Nice one..
After struggling to do this for so long and confusing instructions for CENTOS 4/5, the instructions above are awesome. Thank you!
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?
Hi Topher,
You could try following command to install OpenJDK 6, when you have OpenJDK 7 installed:
Thanks! Worked like a charm!
Excellent! :)
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.
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.
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.
This tutorial rock!
Hi JR,
Thanks a lot you save my night!
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
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:
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.
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
Hi txe,
Could you post output of following command:
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] ~]$
Thanks, it looks good, could you then post output of following commands:
And then also output of following command:
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] ~]$
Sorry, I wrote actually wrong path, could you also post output of following commands:
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] ~]$
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!
thanks for great support
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] ~]$
Let’s continue here, this discussion.
First run following commands (remove your current linking):
Then install java, javaws and java plugin again:
Then try:
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.
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:
Then you can check that it’s properly updated using following command:
And you can check browser plugin version on about:plugins page.
Ah!. Ok. but don’t I have to uninstall the previous one version or something like that?
Thanks!
Txe.
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.