1.查看java的所有版本:
yum list java*
输出:
[root@localhost ~]# yum list java*
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* centos-sclo-rh: ftp.sjtu.edu.cn* centos-sclo-sclo: ftp.sjtu.edu.cn* extras: mirrors.ustc.edu.cn* updates: mirrors.ustc.edu.cn
可安装的软件包
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.261-2.6.22.2.el7_8 base
java-1.7.0-openjdk-accessibility.x86_64 1:1.7.0.261-2.6.22.2.el7_8 base
java-1.7.0-openjdk-demo.x86_64 1:1.7.0.261-2.6.22.2.el7_8 base
java-1.7.0-openjdk-devel.x86_64 1:1.7.0.261-2.6.22.2.el7_8 base
java-1.7.0-openjdk-headless.x86_64 1:1.7.0.261-2.6.22.2.el7_8 base
java-1.7.0-openjdk-javadoc.noarch 1:1.7.0.261-2.6.22.2.el7_8 base
java-1.7.0-openjdk-src.x86_64 1:1.7.0.261-2.6.22.2.el7_8 base
java-1.8.0-openjdk.i686 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk.x86_64 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-accessibility.i686 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-accessibility.x86_64 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-demo.i686 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-demo.x86_64 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-devel.i686 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-devel.x86_64 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-headless.i686 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-javadoc.noarch 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-javadoc-zip.noarch 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-src.i686 1:1.8.0.392.b08-2.el7_9 updates
java-1.8.0-openjdk-src.x86_64 1:1.8.0.392.b08-2.el7_9 updates
java-11-openjdk.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-demo.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-demo.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-devel.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-devel.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-headless.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-headless.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-javadoc.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-javadoc.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-javadoc-zip.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-javadoc-zip.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-jmods.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-jmods.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-src.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-src.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-static-libs.i686 1:11.0.21.0.9-1.el7_9 updates
java-11-openjdk-static-libs.x86_64 1:11.0.21.0.9-1.el7_9 updates
java-atk-wrapper.i686 0.30.4-5.el7 base
java-atk-wrapper.x86_64 0.30.4-5.el7 base
java-dirq.noarch 1.8-1.el7 epel
java-dirq-javadoc.noarch 1.8-1.el7 epel
java-oauth.noarch 20100601-13.el7 epel
java-oauth-javadoc.noarch 20100601-13.el7 epel
java-runtime-decompiler.noarch 5.1-1.el7 epel
java-runtime-decompiler-javadoc.noarch 5.1-1.el7 epel
java_cup.noarch 1:0.11a-16.el7 base
java_cup-javadoc.noarch 1:0.11a-16.el7 base
java_cup-manual.noarch 1:0.11a-16.el7 base
javacc.noarch 5.0-10.el7 base
javacc-demo.noarch 5.0-10.el7 base
javacc-javadoc.noarch 5.0-10.el7 base
javacc-manual.noarch 5.0-10.el7 base
javacc-maven-plugin.noarch 2.6-17.el7 base
javacc-maven-plugin-javadoc.noarch 2.6-17.el7 base
javamail.noarch 1.4.6-8.el7 base
javamail-javadoc.noarch 1.4.6-8.el7 base
javapackages-tools.noarch 3.4.1-11.el7 base
javaparser.noarch 1.0.11-3.el7 epel
javaparser-javadoc.noarch 1.0.11-3.el7 epel
javassist.noarch 3.16.1-10.el7 base
javassist-javadoc.noarch 3.16.1-10.el7 base
javastroke.x86_64 0.5.1-33.el7 epel
javawriter.noarch 2.5.1-4.el7 epel
javawriter-javadoc.noarch
2.安装java-11:
yum install yum install java-11-openjdk.x86_64