1、查询jdk版本
java -version
结果如下:
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
2、查找已安装的jdk
rpm -qa | grep jdk
结果如下:
java-1.8.0-openjdk-1.8.0.312.b07-1.el7_9.x86_64
java-1.8.0-openjdk-devel-1.8.0.312.b07-1.el7_9.x86_64
copy-jdk-configs-3.3-10.el7_5.noarch
java-1.8.0-openjdk-headless-1.8.0.312.b07-1.el7_9.x86_64
3、卸载(.noarch可不删除)
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.312.b07-1.el7_9.x86_64 rpm -e --nodeps java-1.8.0-openjdk-devel-1.8.0.312.b07-1.el7_9.x86_64 rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.312.b07-1.el7_9.x86_64