查看
rpm -qa | grep java
rpm -qa | grep jdk

批量卸载
rpm -qa | grep jdk | xargs rpm -e --nodeps
rpm -qa | grep java | xargs rpm -e --nodeps

单独卸载
rpm -e --nodeps java-11-openjdk

yum list | grep java #全部
yum search java-11-openjdk #指定版本

yum install -y java-11-openjdk

通过yum方式安装默认安装在/usr/lib/jvm文件下
which Java

export JAVA_HOME=
export CLASSPATH=.:${JAVA_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

source /etc/profile

java -version