xqlee 1548 0 2017-08-01 22:33:07

一、yum安装jdk8

1.1查看当前可以安装的版本

命令:

[root@localhost ~]# yum list|grep jdk

copy-jdk-configs.noarch                      1.3-1.el6                   base  

java-1.6.0-openjdk.x86_64                    1:1.6.0.41-1.13.13.1.el6_8  base  

java-1.6.0-openjdk-demo.x86_64               1:1.6.0.41-1.13.13.1.el6_8  base  

java-1.6.0-openjdk-devel.x86_64              1:1.6.0.41-1.13.13.1.el6_8  base  

java-1.6.0-openjdk-javadoc.x86_64            1:1.6.0.41-1.13.13.1.el6_8  base  

java-1.6.0-openjdk-src.x86_64                1:1.6.0.41-1.13.13.1.el6_8  base  

java-1.7.0-openjdk.x86_64                    1:1.7.0.141-2.6.10.1.el6_9  updates

java-1.7.0-openjdk-demo.x86_64               1:1.7.0.141-2.6.10.1.el6_9  updates

java-1.7.0-openjdk-devel.x86_64              1:1.7.0.141-2.6.10.1.el6_9  updates

java-1.7.0-openjdk-javadoc.noarch            1:1.7.0.141-2.6.10.1.el6_9  updates

java-1.7.0-openjdk-src.x86_64                1:1.7.0.141-2.6.10.1.el6_9  updates

java-1.8.0-openjdk.x86_64                    1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-debug.x86_64              1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-demo.x86_64               1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-demo-debug.x86_64         1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-devel.x86_64              1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-devel-debug.x86_64        1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-headless.x86_64           1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-headless-debug.x86_64     1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-javadoc.noarch            1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-javadoc-debug.noarch      1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-src.x86_64                1:1.8.0.131-0.b11.el6_9     updates

java-1.8.0-openjdk-src-debug.x86_64          1:1.8.0.131-0.b11.el6_9     updates

ldapjdk.x86_64                               4.18-8.el6                  base  

ldapjdk-javadoc.x86_64                       4.18-8.el6                  base

 

如果没有看到上面的版本,安装/更新centos的扩展源

#yum –y  install epel-release

1.2安装jdk1.8

命令:

[root@localhost ~]# yum install -y java-1.8.0-openjdk

可用jdk版本

二、检查安装

命令:

[root@localhost ~]# java –version

openjdk version "1.8.0_131"

OpenJDK Runtime Environment (build 1.8.0_131-b11)

OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

 

如上显示出jdk版本标示已经成功安装

编程技术 centos6 jdk8