Steps to upgrade Java on a Linux Server.
-
Go to the “/usr/local/src/” directory.
cd /usr/local/src/
-
Download the latest package[rpm]
from the following page using “wget”.
http://www.java.com/en/download/manual.jsp#lin
-
Install the rpm.
[root@vm src]# rpm -Uvh jre-7u7-linux-x64.rpm
Preparing... ########################################### [100%]
package jre-1.7.0_07-fcs.x86_64 is installed
[root@vm src]# -
Update the “symbolic links”
using the following commands.
[root@vm src]# update-alternatives --install /usr/bin/java java /usr/java/jre1.7.0_07/bin/java 3
[root@vm src]# alternatives --config javaThere are 3 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
2 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
3 /usr/java/jre1.7.0_07/bin/javaEnter to keep the current selection[+], or type selection number: 3
[root@vm src]# -
Verify the Java version
[root@vm src]# java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)