Centos安装配置Java8

查看Centos发行版本

[root@lavm-ik3g4r3pga ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

查看java8安装包

[root@lavm-ik3g4r3pga ~]# yum list java-1.8*
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast

安装java8

[root@lavm-ik3g4r3pga ~]# yum install java-1.8.0-openjdk.x86_64
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
base                         
[root@lavm-ik3g4r3pga ~]# yum install java-1.8.0-openjdk-devel.x86_64
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-openjdk-devel.x86_64 1:1.8.0.372.b07-1.el7_9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

查看安装效果

[root@lavm-ik3g4r3pga ~]# java -version
openjdk version "1.8.0_372"
OpenJDK Runtime Environment (build 1.8.0_372-b07)
OpenJDK 64-Bit Server VM (build 25.372-b07, mixed mode)
[root@lavm-ik3g4r3pga ~]# javac -version
javac 1.8.0_372
posted @ 2024-03-19 13:55  小何同學  阅读(86)  评论(0编辑  收藏  举报