先删除,后安装
126 mkdir /usr/local/java
127 tar -xzvf jdk-8u231-linux-x64.tar.gz -C /usr/local/java
129 rpm -qa | grep java
130 rpm -qa | grep java |grep -vnoarch
131 rpm -qa | grep java |grep -v noarch
132 rpm -e --nodeps java-1.8.0-openjdk-1.8.0.312.b07-2.el8_5.x86_64
133 rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.312.b07-2.el8_5.x86_64
134 rpm -qa | grep java |grep -v noarch
135 java -version
137 vim /etc/profile
138 source /etc/profile
139 java -version
/etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_231
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin