Sunday, February 26, 2012

Java On CentOS

[root@host opt]# wget http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.rpm
--2012-02-27 12:08:07-- http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.rpm
Resolving download.oracle.com... 58.27.22.9, 58.27.22.56
Connecting to download.oracle.com|58.27.22.9|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 67667318 (65M) [application/x-redhat-package-manager]
Saving to: âjdk-7u3-linux-x64.rpmâ

100%[===================================================================================================================>] 67,667,318 738K/s in 64s

2012-02-27 12:09:11 (1.00 MB/s) - âjdk-7u3-linux-x64.rpmâ

[root@host opt]# ls
jdk-7u3-linux-x64.rpm php-java-bridge_6.2.1_documentation.zip php-java-bridge_6.2.1.tar.gz

[root@host opt]# rpm -Uvh jdk-7u3-linux-x64.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...

[root@host opt]# alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 20000

[root@host opt]# alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000

[root@host opt]# alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 20000

[root@host opt]# alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 20000

[root@host opt]# java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)

[root@host opt]#

No comments: