腾讯云CentOS 7.5 使用yum方式安装JDK

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xinglu31/article/details/85016487

腾讯云CentOS 7.5 使用yum方式安装JDK

1. 查找yum中的jdk : sudo yum list | grep jdk*

[root@VM_0_10_centos ~]# sudo yum list | grep jdk*
ant-jdepend.noarch                      1.9.4-2.el7                    os
cjdns.x86_64                            20.2-5.el7                     epel
cjdns-graph.noarch                      20.2-5.el7                     epel
cjdns-selinux.noarch                    20.2-5.el7                     epel
cjdns-tools.noarch                      20.2-5.el7                     epel
copy-jdk-configs.noarch                 3.3-10.el7_5                   os
java-1.6.0-openjdk.x86_64               1:1.6.0.41-1.13.13.1.el7_3     os
java-1.6.0-openjdk-demo.x86_64          1:1.6.0.41-1.13.13.1.el7_3     os
java-1.6.0-openjdk-devel.x86_64         1:1.6.0.41-1.13.13.1.el7_3     os
java-1.6.0-openjdk-javadoc.x86_64       1:1.6.0.41-1.13.13.1.el7_3     os
java-1.6.0-openjdk-src.x86_64           1:1.6.0.41-1.13.13.1.el7_3     os
java-1.7.0-openjdk.x86_64               1:1.7.0.201-2.6.16.1.el7_6     updates
java-1.7.0-openjdk-accessibility.x86_64 1:1.7.0.201-2.6.16.1.el7_6     updates
java-1.7.0-openjdk-demo.x86_64          1:1.7.0.201-2.6.16.1.el7_6     updates
java-1.7.0-openjdk-devel.x86_64         1:1.7.0.201-2.6.16.1.el7_6     updates
java-1.7.0-openjdk-headless.x86_64      1:1.7.0.201-2.6.16.1.el7_6     updates
java-1.7.0-openjdk-javadoc.noarch       1:1.7.0.201-2.6.16.1.el7_6     updates
java-1.7.0-openjdk-src.x86_64           1:1.7.0.201-2.6.16.1.el7_6     updates
java-1.8.0-openjdk.i686                 1:1.8.0.191.b12-1.el7_6        updates
java-1.8.0-openjdk.x86_64               1:1.8.0.191.b12-1.el7_6        updates
java-1.8.0-openjdk-accessibility.i686   1:1.8.0.191.b12-1.el7_6        updates
java-1.8.0-openjdk-accessibility.x86_64 1:1.8.0.191.b12-1.el7_6        updates

2. 选择要按照的JDK

[root@VM_0_10_centos ~]# sudo yum install java-1.8.0-openjdk*
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check

3. 安装成功后,查看Java版本

[root@VM_0_10_centos ~]# java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

4. 安装成功后,查看Java版本

[root@VM_0_10_centos ~]# javac -version
javac 1.8.0_191

5. 主要参考

没有更多推荐了,返回首页