This is guide, howto Install Sun/Oracle Java JDK and JRE 7 update 21 (7u21) on Fedora 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.
5. Check current java, javac, javaws and libjavaplugin.so versions
java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b04)
Java HotSpot(TM)64-Bit Server VM (build 22.1-b02, mixed mode)
javaws
Java(TM) Web Start 10.0.0.4-fcs
[...]
javac -version
javac 1.7.0_21
Note: Check libjavaplugin.so with restarting Mozilla Firefox and writing about:plugins on address bar.
Java 7 console output on Fedora 18:
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_21/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_21/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_21/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_21/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_21/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)
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:
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:
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?
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.
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.
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
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, at the first step, when i try to install i get this message :
[root@fedoracore 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.
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.
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/
[root@localhost Downloads]# ls
jre-7u15-linux-i586.rpm
[root@localhost 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
[root@localhost Downloads]#
I don’t what I’m overlooking, I’d appreciate any clue.
Thanks.
Txe
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
## 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:
[txe@localhost Downloads]$ java --version
bash: java: command not found...
[txe@localhost 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)
[txe@localhost Downloads]$
Any help, please?, please..
Txe.
Hi JR.
Thanks for your reply
This the output I got:
[txe@localhost ~]$ 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
[txe@localhost ~]$
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.
[txe@localhost ~]$ /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.
[txe@localhost ~]$
[txe@localhost ~]$ /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.
[txe@localhost ~]$
Pepinho DoSamba / February 28, 2013
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!
Hi JR,
Thanks again. Here both outputs:
[txe@localhost ~]$ /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.
[txe@localhost ~]$
------------------------
[txe@localhost ~]$ /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.
[txe@localhost ~]$
Hi JR,
Thanks for your reply. This is the output I got now:
[root@localhost 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)
[root@localhost 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.
I just tried to install JDK 7-17 on Fedora 18 and got the following error on Step 3. Your assistance would be appreciated:
[root@localhost ~]# rpm -Uvh /var/tmp/jdk-7u17-linux-x64.rpm
Preparing… ################################# [100%]
Updating / installing…
1:jdk-2000:1.7.0_17-fcs ################################# [100%]
Unpacking JAR files…
rt.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/jre/lib/rt.pack
jsse.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/jre/lib/jsse.pack
charsets.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/jre/lib/charsets.pack
tools.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/lib/tools.pack
localedata.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/jre/lib/ext/localedata.pack
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.
I want to say first I am running Centos 6.4 in a virtuabox. I don’t think that should be an issue,
I removed open java yum remove java
then I downloaded the latest oracle java
I installed rpm -ivh jdk-7u17-linux-x64.rpm
then I alternatives –install /usr/bin/java java /usr/java/latest/jre/bin/java 20000
then rnatives –install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.s
then I linked the plugin to ~/.mozilla/plugins
Now whenever I hit a java site firefox crashes. It goes down fast too. I don’t even know what to check
If I look at about:plugins I see the java plugins
java -version
java version “1.7.0_17″
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java Hotspot(TM) 64-Bit Server VM (Build 23.7-b01, mixed mode)
any ideas on why firefox is crashing now would be appreciated.
@pmkehdvs1001:~/.mozilla/plugins$ ls -la /usr/lib64/mozilla/plugins/libjavaplugin.so
lrwxrwxrwx. 1 root root 41 Mar 16 22:45 /usr/lib64/mozilla/plugins/libjavaplugin.so -> /etc/alternatives/libjavaplugin.so.x86_64
Ok done, but firefox still crashes on java pages. If I open firefox and type in javatest in the search bar it hangs for a second then disappears. If I type in cars it will work find and go to wesites with cars in them.
Hi JR, Well after hours of playing with it, I remembered that I was building this in a virtualbox. I decided to just start over, and what ever I did wrong or whatever went wrong went right with the second VM. Thank you for your help. I am all good now.
Hi,
Thanks for the nice guide. I tried to follow your instructions but I run across problems. I’ll be thankful if you can help me out.
When I run
$ rpm -Uvh ../jdk-7u21-linux-i586.rpm
the output was:
Preparing… ########################################### [100%]
1:jdk ########################################### [100%]
error: unpacking of archive failed on file /usr/java/jdk1.7.0_21/db/lib/derby.jar;517bea0a: cpio: Digest mismatch
I tried to ignore it, but when I run
alternatives –install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/lib/i386/libnpjp2.so 20000
the output was:
failed to read link /usr/lib/mozilla/plugins/libjavaplugin.so: No such file or directory
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/ -- ...
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:
Hi mervs,
Actually alternatives –install commands doesn’t create folders, it just create symbolic links. Could you post output of following commands:
Amazing post guys! Very useful !
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 :
[root@fedoracore 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/
[root@localhost Downloads]# ls
jre-7u15-linux-i586.rpm
[root@localhost 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
[root@localhost 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:
rpm -Uvh jre-7u15-linux-i586.rpmHi 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 20000Whit 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:[txe@localhost Downloads]$ java --version
bash: java: command not found...
[txe@localhost 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)
[txe@localhost 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:
[txe@localhost ~]$ 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
[txe@localhost ~]$
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.
[txe@localhost ~]$ 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.
[txe@localhost ~]$
------------------------
[txe@localhost ~]$ 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.
[txe@localhost ~]$
---------------------
[txe@localhost ~]$ 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.
[txe@localhost ~]$
----------------------
[txe@localhost ~]$ /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
[txe@localhost ~]$
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.
[txe@localhost ~]$ /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.
[txe@localhost ~]$
[txe@localhost ~]$ /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.
[txe@localhost ~]$
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:
[txe@localhost ~]$ /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.
[txe@localhost ~]$
------------------------
[txe@localhost ~]$ /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.
[txe@localhost ~]$
Let’s continue here, this discussion.
First run following commands (remove your current linking):
Then install java, javaws and java plugin again:
Then try:
java -versionHi JR,
Thanks for your reply. This is the output I got now:
[root@localhost 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)
[root@localhost 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:
java -versionAnd 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.
Hi All,
I found that on Fedora 18 the shared library libX11 is missing and without it, javaws won’t run. You can het it here: http://pkgs.org/fedora-18/fedora-i386/libX11-1.5.0-3.fc18.i686.rpm/download/
T.
Hi Tiago and thanks!
You can also install it using yum:
yum install libX11Thanks a lot for this very useful instructions!
Best regards.
Aníbal
I just tried to install JDK 7-17 on Fedora 18 and got the following error on Step 3. Your assistance would be appreciated:
[root@localhost ~]# rpm -Uvh /var/tmp/jdk-7u17-linux-x64.rpm
Preparing… ################################# [100%]
Updating / installing…
1:jdk-2000:1.7.0_17-fcs ################################# [100%]
Unpacking JAR files…
rt.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/jre/lib/rt.pack
jsse.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/jre/lib/jsse.pack
charsets.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/jre/lib/charsets.pack
tools.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/lib/tools.pack
localedata.jar…
Error: Could not open input file: /usr/java/jdk1.7.0_17/jre/lib/ext/localedata.pack
Hi getcar,
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.
I want to say first I am running Centos 6.4 in a virtuabox. I don’t think that should be an issue,
I removed open java yum remove java
then I downloaded the latest oracle java
I installed rpm -ivh jdk-7u17-linux-x64.rpm
then I alternatives –install /usr/bin/java java /usr/java/latest/jre/bin/java 20000
then rnatives –install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.s
then I linked the plugin to ~/.mozilla/plugins
Now whenever I hit a java site firefox crashes. It goes down fast too. I don’t even know what to check
If I look at about:plugins I see the java plugins
java -version
java version “1.7.0_17″
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java Hotspot(TM) 64-Bit Server VM (Build 23.7-b01, mixed mode)
any ideas on why firefox is crashing now would be appreciated.
Thanks again,
Mike
Hi Mike,
It’s not needed to link ~/.mozilla/plugins, if you run following command (Java JRE installation):
So remove link from ~/.mozilla/plugins and check output of following command:
@pmkehdvs1001:~/.mozilla/plugins$ ls -la /usr/lib64/mozilla/plugins/libjavaplugin.so
lrwxrwxrwx. 1 root root 41 Mar 16 22:45 /usr/lib64/mozilla/plugins/libjavaplugin.so -> /etc/alternatives/libjavaplugin.so.x86_64
Ok done, but firefox still crashes on java pages. If I open firefox and type in javatest in the search bar it hangs for a second then disappears. If I type in cars it will work find and go to wesites with cars in them.
Hi Mike,
Could you post also output of following commands:
Hi JR, Well after hours of playing with it, I remembered that I was building this in a virtualbox. I decided to just start over, and what ever I did wrong or whatever went wrong went right with the second VM. Thank you for your help. I am all good now.
Thanks again,
Mike
Hi Mike,
You are welcome! Nice to hear that you got it working!
Thanks very much for the post!
Hi,
Thanks for the nice guide. I tried to follow your instructions but I run across problems. I’ll be thankful if you can help me out.
When I run
$ rpm -Uvh ../jdk-7u21-linux-i586.rpm
the output was:
Preparing… ########################################### [100%]
1:jdk ########################################### [100%]
error: unpacking of archive failed on file /usr/java/jdk1.7.0_21/db/lib/derby.jar;517bea0a: cpio: Digest mismatch
I tried to ignore it, but when I run
alternatives –install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/lib/i386/libnpjp2.so 20000
the output was:
failed to read link /usr/lib/mozilla/plugins/libjavaplugin.so: No such file or directory
What is the problem here?
Thanks,