1、通过xshell登录centos,在Centos7上,通过yum install java,可以得到所有openjdk的版本。如图所示:
选择需要安装的版本,执行:yum install java-1.8.0-openjdk-devel-debug.x86_64 中间直接输入 y 即可。
[root@CentOS ~]# yum install java-1.8.0-openjdk-devel-debug.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-openjdk-devel-debug.x86_64 1:1.8.0.232.b09-0.el7_7 will be installed
--> Processing Dependency: java-1.8.0-openjdk-debug(x86-64) = 1:1.8.0.232.b09-0.el7_7 for package: 1:java-1.8.0-openjdk-devel-debug-1.8.0.232.b09-0.el7_7.x86_64
--