Friday, March 02, 2012

Change the Default Java in CentOS 6


http://chrisschuld.com/2008/10/installing-sun-java-on-centos-5-2/

Step (1) : Visit Oracle's web site to find the laest version of JRE http://www.oracle.com/technetwork/java/javase/downloads/index.html

Step (2) : Download the rpm file for JRE 1.7u3 x64
http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jre-7u3-linux-x64.rpm

Step (3) : Setup the alternatives correctly
[user@www]# alternatives --install /usr/bin/java java /usr/java/jre1.7.0_03/bin/java 2
[user@www]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
   2           /opt/jdk1.6.0_07/bin/java

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

Step (4) : Check to make sure the install was a success
[user@www]# java -version

No comments: