使用“yum list”命令查看openjdk列表
yum list *openjdk*
#可用列表
Available Packages
java-1.6.0-openjdk.x86_64 1:1.6.0.41-1.13.13.1.el7_3 base
java-1.6.0-openjdk-demo.x86_64 1:1.6.0.41-1.13.13.1.el7_3 base
java-1.6.0-openjdk-devel.x86_64 1:1.6.0.41-1.13.13.1.el7_3 base
java-1.6.0-openjdk-javadoc.x86_64 1:1.6.0.41-1.13.13.1.el7_3 base
java-1.6.0-openjdk-src.x86_64 1:1.6.0.41-1.13.13.1.el7_3 base
java-1.7.0-openjdk.x86_64 1:1.7.0.241-2.6.20.0.el7_7 updates
java-1.7.0-openjdk-accessibility.x86_64 1:1.7.0.241-2.6.20.0.el7_7 updates
java-1.7.0-openjdk-demo.x86_64 1:1.7.0.241-2.6.20.0.el7_7 updates
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.241-2.6.20.0.el7_7 updates
java-1.7.0-openjdk-headless.x86_64 1:1.7.0.241-2.6.20.0.el7_7 updates
java-1.7.0-openjdk-javadoc.noarch 1:1.7.0.241-2.6.20.0.el7_7 updates
java-1.7.0-openjdk-src.x86_64 1:1.7.0.241-2.6.20.0.el7_7 updates
java-1.8.0-openjdk.i686 1:1.8.0.232.b09-0.el7_7 updates
java-1.8.0-openjdk-accessibility.i686 1:1.8.0.232.b09-0.el7_7 updates
java-1.8.0-openjdk-accessibility-debug.i686 1:1.8.0.232.b09-0.el7_7 updates
java-1.8.0-openjdk-debug.i686 1:1.8.0.232.b09-0.el7_7 updates
java-1.8.0-openjdk-demo.i686 1:1.8.0.232.b09-0.el7_7 updates
...
使用“yum install”安装openjdk1.8的所有组件
#安装组件
yum install java-1.8.0-openjdk* -y
#安装过程
...
使用“java -version”查看安装结果
#查看jdk版本
java -version
#显示内容
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
lizz666 发布了60 篇原创文章 · 获赞 10 · 访问量 2万+ 私信 关注