HardBirch

CentOS上yum安装JDK

时间:17-01-20 栏目:JAVA语言-JVM虚拟机 作者:魔豆先生 评论:0 点击: 1,084 次

了搭建测试环境

1 在vmware 下安装了x86-64-bit的Linux

2 新建虚拟机中选择 iso,然后一路next

3 root登入新的虚拟机

4 查看有无安装jdk命令:#Java -version

5 yum安装jdk

 

首先,我们来看看yum库是否有java安装包

[root@233797 www.ctohome.com]yum -y list java*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.grikare.com
 * extras: centos.mirror.facebook.NET
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: mirror.grikare.com
Excluding Packages in global exclude list
Finished
Available Packages
java-1.4.2-gcj-compat.i386                                                              1.4.2.0-40jpp.115                                                                base   
java-1.4.2-gcj-compat-devel.i386                                                        1.4.2.0-40jpp.115                                                                base   
java-1.4.2-gcj-compat-javadoc.i386                                                      1.4.2.0-40jpp.115                                                                base   
java-1.4.2-gcj-compat-src.i386                                                          1.4.2.0-40jpp.115                                                                base   
java-1.6.0-openjdk.i386                                                                 1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
java-1.6.0-openjdk-demo.i386                                                            1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
java-1.6.0-openjdk-devel.i386                                                           1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
java-1.6.0-openjdk-javadoc.i386                                                         1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
java-1.6.0-openjdk-src.i386                                                             1:1.6.0.0-1.23.1.9.10.el5_7                                                      updates
java_cup.i386                                                                           1:0.10-0.k.6jpp.1                                                                base   
java_cup-javadoc.i386                                                                   1:0.10-0.k.6jpp.1                                                                base   
java_cup-manual.i386                                                                    1:0.10-0.k.6jpp.1                                                                base   
javacc.i386                                                                             4.0-3jpp.3                                                                       base   
javacc-demo.i386                                                                        4.0-3jpp.3                                                                       base   
javacc-manual.i386                                                                      4.0-3jpp.3     

 

然后我们安装java1.6.x,怎样使用yum安装java? 怎么用yum安装jdk

[root@233797 www.ctohome.com]yum -y install  java-1.6.0-openjdk*

 

查看yum安装java的结果,安装完成后,执行java -version

[root@233797 www.ctohome.com]java -version
Java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (rhel-1.23.1.9.10.el5_7-i386)
OpenJDK Client VM (build 19.0-b09, mixed mode)

 

6 安装成功

7 如安装不成功,参见http://www.idcus.net/show.asp?id=34

声明: 本文由( 魔豆先生 )原创编译,转载请保留链接: CentOS上yum安装JDK

CentOS上yum安装JDK:等您坐沙发呢!

发表评论


QQ群互动

Linux系统与内核学习群:194051772

WP建站技术学习交流群:194062106

魔豆之路QR

魔豆的Linux内核之路

魔豆的Linux内核之路

优秀工程师当看优秀书籍

优秀程序员,要看优秀书!

赞助商广告

友荐云推荐