查看JAVA版本
$java -version
系统自带的是JAVA-OPENJDK,需要先卸载
[[email protected] ~]# rpm -qa | grep java
javapackages-tools-3.4.1-6.el7_0.noarch
tzdata-java-2014i-1.el7.noarch
java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64
java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64
python-javapackages-3.4.1-6.el7_0.noarch
卸载OpenJDK,执行以下操作:
[[email protected]~]#rpm -e --nodeps tzdata-java-2014i-1.el7.noarch
[[email protected]~]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.71-2.5.3.1.el7_0.x86_64
[[email protected]~]#rpm -e --nodeps java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64
安装ORALCE JDK
去ORCLE官网下载jdk-8u45-linux-x64.rpm
下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html
[[email protected]~]#cd Downloads
[[email protected]~]#yum localinstall jdk-8u45-linux-x64.rpm