---恢复内容开始---

1.卸载openjdk

1.1 查看已安装的依赖

rpm -qa |grep java

java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el7_6.x86_64
python-javapackages-3.4.1-11.el7.noarch
tzdata-java-2018i-1.el7.noarch
java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64
javapackages-tools-3.4.1-11.el7.noarch

1.2,卸载已安装依赖

rpm -e --nodeps +以上依赖名

java-1.8.0-openjdk-headless-1.8.0.201.b09-2.el7_6.x86_64
python-javapackages-3.4.1-11.el7.noarch
tzdata-java-2018i-1.el7.noarch
java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64
javapackages-tools-3.4.1-11.el7.noarch

2 解压jdk

mkdir -p /usr/lib/jvm

mv jdk-12 /etc/lib/jvm

3 配置环境变量

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_131  
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export  PATH=${JAVA_HOME}/bin:$PATH

#写入、/etc/profile

jdk安装完毕

 

 

 

---恢复内容结束---