下載最新的JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.htmlhtml
檢驗系統原版本
[root@localhost ~]# java -version
java version "1.7.0_24"
OpenJDK Runtime Environment (build 1.7.0_24-b18)
OpenJDK HotSpot(TM) Client VM (build 24.45-b08, mixed mode, sharing)node
進一步查看JDK信息:
[root@localhost ~]# rpm -qa | grep java
tzdata-java-2012c-1.el6.noarch
java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64linux
卸載OpenJDK,執行如下操做:
[root@localhost ~]# rpm -e --nodeps tzdata-java-2012c-1.el6.noarch
[root@localhost ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.45-1.45.1.11.1.el6.x86_64oracle
安裝JDK
上傳新的軟件到/usr/local/執行如下操做:
[root@localhost ckb]# rpm -ivh jdk-8u65-linux-x64.rpm
JDK默認安裝在/usr/java中。ui
驗證安裝
執行如下操做,查看信息是否正常:
[root@localhost bin]# java
[root@localhost bin]# javac
[root@localhost bin]# java -version
spa