Setup Oracle Java jre 1.7 on Centos 6.3

Share

Download the rpm file from java.com

Install using the rpm command

rpm -Uvh jre-7u13-linux-x64.rpm

Use alternatives to config

# alternatives –config java

There are 3 programs which provide ‘java’.

  Selection    Command
———————————————–
*  1           /usr/java/latest/jre/bin/java
 + 2           /usr/java/jre1.7.0_13/bin/java
   3           /usr/java/jdk1.7.0_13/jre/bin/java

Enter to keep the current selection[+], or type selection number:

Select the java you want to use in my case 2

Test using the command #java -version

java -version
java version “1.7.0_13”
Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
[root@localhost plugins]#

Create links in the Mozilla Plugins directory so Java will work in supported browsers such as Firefox.

# cd /usr/lib64/mozilla/plugins/
# ln -fs /usr/java/latest/lib/amd64/libnpjp2.so