rpm -qa|grep jdk
然后卸载看到的jdk
yum -y remove java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64
java –version
tar -zxvf jdk-8u191-linux-x64.tar.gz -C /usr/local/java/()
tar -zxvf jdk-8u191-linux-x64.tar.gz -C .
mv jdk-8u191-linux-x64 java
安装完毕之后在/etc/profile文件末尾添加
vim /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_191
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
source /etc/profile
java –version
网友评论