Download the appropriate JDK RPM file (check for the correct architecture - 32 or 64 bit)
This is the command for downloading the rpm for a 64bit architecture:
# wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-linux-x64.rpm
Install the JDK RPM
# rpm -Uvh ~/jdk-7u60-linux-x64.rpm
Install alternatives
# alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_60/jre/bin/java 20000
# alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7.0_60/jre/bin/javaws 20000
# alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_60/bin/javac 20000
# alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_60/bin/jar 20000
Update alternatives (Enter Selection ID of the installation you need to be selected as default)
# alternatives --config java
# alternatives --config javaws
# alternatives --config javac
# alternatives --config jar
Check the default version of java
# java -version
No comments:
Post a Comment