在CentOS系统上安装Java的openjdk的方法

CentOS 6.X 和 5.X 自带有OpenJDK runtime environment  (openjdk)。它是一个在linux上实现开源的java 平台。CentOS  yum 命令 安装 Java SDK openjdk

centos linux JAVA(openjdk)软件包名
1.java-1.7.0-openjdk - OpenJDK Runtime Environment
2.java-1.7.0-openjdk-devel - OpenJDK Development Environment

输入以下命令,以查看可用的JDK软件包列表;

[root@dabu.info ~]# yum search java | grep -i --color JDK

输出类似下图:

centos-openjdk

在CentOS linux安装 JAVA SDK
在命令行终端以root用户 输入以下命令yum安装 OpenSDK :

[root@dabu.info ~]#yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel #安装openjdk

输出如下:

Loaded plugins: downloadonly, fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.wiredtree.com
 * epel: mirror.steadfast.net
 * extras: bay.uchicago.edu
 * updates: mirror.team-cymru.org
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package java-1.7.0-openjdk.x86_64 1:1.7.0.51-2.4.4.1.el6_5 will be installed
--> Processing Dependency: jpackage-utils >= 1.7.3-1jpp.2 for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: xorg-x11-fonts-Type1 for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: tzdata-java for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: rhino for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libpulse.so.0(PULSE_0)(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libasound.so.2(ALSA_0.9.0rc4)(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libasound.so.2(ALSA_0.9)(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libpulse.so.0()(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libgif.so.4()(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libasound.so.2()(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Processing Dependency: libXtst.so.6()(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64
--> Running transaction check
---> Package alsa-lib.x86_64 0:1.0.22-3.el6 will be installed
---> Package giflib.x86_64 0:4.1.6-3.1.el6 will be installed
--> Processing Dependency: libSM.so.6()(64bit) for package: giflib-4.1.6-3.1.el6.x86_64
--> Processing Dependency: libICE.so.6()(64bit) for package: giflib-4.1.6-3.1.el6.x86_64
---> Package jpackage-utils.noarch 0:1.7.5-3.12.el6 will be installed
---> Package libXtst.x86_64 0:1.2.1-2.el6 will be installed
---> Package pulseaudio-libs.x86_64 0:0.9.21-14.el6_3 will be installed
--> Processing Dependency: libsndfile.so.1(libsndfile.so.1.0)(64bit) for package: pulseaudio-libs-0.9.21-14.el6_3.x86_64
--> Processing Dependency: libsndfile.so.1()(64bit) for package: pulseaudio-libs-0.9.21-14.el6_3.x86_64
--> Processing Dependency: libasyncns.so.0()(64bit) for package: pulseaudio-libs-0.9.21-14.el6_3.x86_64
---> Package rhino.noarch 0:1.7-0.7.r2.2.el6 will be installed
--> Processing Dependency: jline for package: rhino-1.7-0.7.r2.2.el6.noarch
---> Package tzdata-java.noarch 0:2013i-2.el6 will be installed
---> Package xorg-x11-fonts-Type1.noarch 0:7.2-9.1.el6 will be installed
--> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-9.1.el6.noarch
--> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-9.1.el6.noarch
--> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.2-9.1.el6.noarch
--> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.2-9.1.el6.noarch
--> Running transaction check
---> Package jline.noarch 0:0.9.94-0.8.el6 will be installed
---> Package libICE.x86_64 0:1.0.6-1.el6 will be installed
---> Package libSM.x86_64 0:1.2.1-2.el6 will be installed
---> Package libasyncns.x86_64 0:0.8-1.1.el6 will be installed
---> Package libsndfile.x86_64 0:1.0.20-5.el6 will be installed
--> Processing Dependency: libvorbisenc.so.2()(64bit) for package: libsndfile-1.0.20-5.el6.x86_64
--> Processing Dependency: libvorbis.so.0()(64bit) for package: libsndfile-1.0.20-5.el6.x86_64
--> Processing Dependency: libogg.so.0()(64bit) for package: libsndfile-1.0.20-5.el6.x86_64
--> Processing Dependency: libFLAC.so.8()(64bit) for package: libsndfile-1.0.20-5.el6.x86_64
---> Package ttmkfdir.x86_64 0:3.0.9-32.1.el6 will be installed
---> Package xorg-x11-font-utils.x86_64 1:7.2-11.el6 will be installed
--> Processing Dependency: libfontenc.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.2-11.el6.x86_64
--> Processing Dependency: libXfont.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.2-11.el6.x86_64
--> Running transaction check
---> Package flac.x86_64 0:1.2.1-6.1.el6 will be installed
---> Package libXfont.x86_64 0:1.4.5-3.el6_5 will be installed
---> Package libfontenc.x86_64 0:1.0.5-2.el6 will be installed
---> Package libogg.x86_64 2:1.1.4-2.1.el6 will be installed
---> Package libvorbis.x86_64 1:1.2.3-4.el6_2.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================
 Package           Arch     Version              Repository   Size
==================================================================================================
Installing:
 java-1.7.0-openjdk     x86_64    1:1.7.0.51-2.4.4.1.el6_5     updates     26 M
Installing for dependencies:
 alsa-lib          x86_64    1.0.22-3.el6           base      370 k
 flac            x86_64    1.2.1-6.1.el6           base      243 k
 giflib           x86_64    4.1.6-3.1.el6           base      37 k
 jline            noarch    0.9.94-0.8.el6          base      86 k
 jpackage-utils       noarch    1.7.5-3.12.el6          base      59 k
 libICE           x86_64    1.0.6-1.el6            base      53 k
 libSM            x86_64    1.2.1-2.el6            base      37 k
 libXfont          x86_64    1.4.5-3.el6_5           updates    136 k
 libXtst           x86_64    1.2.1-2.el6            base      29 k
 libasyncns         x86_64    0.8-1.1.el6            base      24 k
 libfontenc         x86_64    1.0.5-2.el6            base      24 k
 libogg           x86_64    2:1.1.4-2.1.el6          base      21 k
 libsndfile         x86_64    1.0.20-5.el6           base      233 k
 libvorbis          x86_64    1:1.2.3-4.el6_2.1         base      168 k
 pulseaudio-libs       x86_64    0.9.21-14.el6_3          base      462 k
 rhino            noarch    1.7-0.7.r2.2.el6         base      778 k
 ttmkfdir          x86_64    3.0.9-32.1.el6          base      43 k
 tzdata-java         noarch    2013i-2.el6            updates    147 k
 xorg-x11-font-utils     x86_64    1:7.2-11.el6           base      75 k
 xorg-x11-fonts-Type1    noarch    7.2-9.1.el6            base      520 k

Transaction Summary
==================================================================================================
Install   21 Package(s)

Total download size: 29 M
Installed size: 100 M
Is this ok [y/N]: y
Downloading Packages:
(1/21): alsa-lib-1.0.22-3.el6.x86_64.rpm                  | 370 kB   00:00
(2/21): flac-1.2.1-6.1.el6.x86_64.rpm                   | 243 kB   00:00
(3/21): giflib-4.1.6-3.1.el6.x86_64.rpm                  | 37 kB   00:00
(4/21): java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64.rpm        | 26 MB   00:02
(5/21): jline-0.9.94-0.8.el6.noarch.rpm                  | 86 kB   00:00
(6/21): jpackage-utils-1.7.5-3.12.el6.noarch.rpm              | 59 kB   00:00
(7/21): libICE-1.0.6-1.el6.x86_64.rpm                   | 53 kB   00:00
(8/21): libSM-1.2.1-2.el6.x86_64.rpm                    | 37 kB   00:00
(9/21): libXfont-1.4.5-3.el6_5.x86_64.rpm                 | 136 kB   00:00
(10/21): libXtst-1.2.1-2.el6.x86_64.rpm                  | 29 kB   00:00
(11/21): libasyncns-0.8-1.1.el6.x86_64.rpm                 | 24 kB   00:00
(12/21): libfontenc-1.0.5-2.el6.x86_64.rpm                 | 24 kB   00:00
(13/21): libogg-1.1.4-2.1.el6.x86_64.rpm                  | 21 kB   00:00
(14/21): libsndfile-1.0.20-5.el6.x86_64.rpm                | 233 kB   00:00
(15/21): libvorbis-1.2.3-4.el6_2.1.x86_64.rpm               | 168 kB   00:00
(16/21): pulseaudio-libs-0.9.21-14.el6_3.x86_64.rpm            | 462 kB   00:00
(17/21): rhino-1.7-0.7.r2.2.el6.noarch.rpm                 | 778 kB   00:00
(18/21): ttmkfdir-3.0.9-32.1.el6.x86_64.rpm                | 43 kB   00:00
(19/21): tzdata-java-2013i-2.el6.noarch.rpm                | 147 kB   00:00
(20/21): xorg-x11-font-utils-7.2-11.el6.x86_64.rpm             | 75 kB   00:00
(21/21): xorg-x11-fonts-Type1-7.2-9.1.el6.noarch.rpm            | 520 kB   00:00
--------------------------------------------------------------------------------------------------
Total                               7.2 MB/s | 29 MB   00:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing : libICE-1.0.6-1.el6.x86_64                           1/21
 Installing : 2:libogg-1.1.4-2.1.el6.x86_64                         2/21
 Installing : libSM-1.2.1-2.el6.x86_64                           3/21
 Installing : libXtst-1.2.1-2.el6.x86_64                          4/21
 Installing : jpackage-utils-1.7.5-3.12.el6.noarch                     5/21
 Installing : alsa-lib-1.0.22-3.el6.x86_64                         6/21
 Installing : libfontenc-1.0.5-2.el6.x86_64                         7/21
 Installing : libXfont-1.4.5-3.el6_5.x86_64                         8/21
 Installing : 1:xorg-x11-font-utils-7.2-11.el6.x86_64                    9/21
 Installing : giflib-4.1.6-3.1.el6.x86_64                         10/21
 Installing : flac-1.2.1-6.1.el6.x86_64                          11/21
 Installing : 1:libvorbis-1.2.3-4.el6_2.1.x86_64                      12/21
 Installing : libsndfile-1.0.20-5.el6.x86_64                        13/21
 Installing : libasyncns-0.8-1.1.el6.x86_64                        14/21
 Installing : pulseaudio-libs-0.9.21-14.el6_3.x86_64                    15/21
 Installing : jline-0.9.94-0.8.el6.noarch                         16/21
 Installing : rhino-1.7-0.7.r2.2.el6.noarch                        17/21
 Installing : tzdata-java-2013i-2.el6.noarch                        18/21
 Installing : ttmkfdir-3.0.9-32.1.el6.x86_64                        19/21
 Installing : xorg-x11-fonts-Type1-7.2-9.1.el6.noarch                   20/21
 Installing : 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64              21/21
 Verifying : pulseaudio-libs-0.9.21-14.el6_3.x86_64                    1/21
 Verifying : ttmkfdir-3.0.9-32.1.el6.x86_64                        2/21
 Verifying : tzdata-java-2013i-2.el6.noarch                        3/21
 Verifying : libXfont-1.4.5-3.el6_5.x86_64                         4/21
 Verifying : libfontenc-1.0.5-2.el6.x86_64                         5/21
 Verifying : flac-1.2.1-6.1.el6.x86_64                           6/21
 Verifying : jline-0.9.94-0.8.el6.noarch                          7/21
 Verifying : alsa-lib-1.0.22-3.el6.x86_64                         8/21
 Verifying : 2:libogg-1.1.4-2.1.el6.x86_64                         9/21
 Verifying : 1:libvorbis-1.2.3-4.el6_2.1.x86_64                      10/21
 Verifying : 1:xorg-x11-font-utils-7.2-11.el6.x86_64                   11/21
 Verifying : xorg-x11-fonts-Type1-7.2-9.1.el6.noarch                   12/21
 Verifying : libSM-1.2.1-2.el6.x86_64                           13/21
 Verifying : libICE-1.0.6-1.el6.x86_64                          14/21
 Verifying : 1:java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5.x86_64              15/21
 Verifying : rhino-1.7-0.7.r2.2.el6.noarch                        16/21
 Verifying : libasyncns-0.8-1.1.el6.x86_64                        17/21
 Verifying : giflib-4.1.6-3.1.el6.x86_64                         18/21
 Verifying : libsndfile-1.0.20-5.el6.x86_64                        19/21
 Verifying : jpackage-utils-1.7.5-3.12.el6.noarch                     20/21
 Verifying : libXtst-1.2.1-2.el6.x86_64                          21/21

Installed:
 java-1.7.0-openjdk.x86_64 1:1.7.0.51-2.4.4.1.el6_5

Dependency Installed:
 alsa-lib.x86_64 0:1.0.22-3.el6         flac.x86_64 0:1.2.1-6.1.el6
 giflib.x86_64 0:4.1.6-3.1.el6          jline.noarch 0:0.9.94-0.8.el6
 jpackage-utils.noarch 0:1.7.5-3.12.el6     libICE.x86_64 0:1.0.6-1.el6
 libSM.x86_64 0:1.2.1-2.el6           libXfont.x86_64 0:1.4.5-3.el6_5
 libXtst.x86_64 0:1.2.1-2.el6          libasyncns.x86_64 0:0.8-1.1.el6
 libfontenc.x86_64 0:1.0.5-2.el6         libogg.x86_64 2:1.1.4-2.1.el6
 libsndfile.x86_64 0:1.0.20-5.el6        libvorbis.x86_64 1:1.2.3-4.el6_2.1
 pulseaudio-libs.x86_64 0:0.9.21-14.el6_3    rhino.noarch 0:1.7-0.7.r2.2.el6
 ttmkfdir.x86_64 0:3.0.9-32.1.el6        tzdata-java.noarch 0:2013i-2.el6
 xorg-x11-font-utils.x86_64 1:7.2-11.el6     xorg-x11-fonts-Type1.noarch 0:7.2-9.1.el6

Complete!

(0)

相关推荐

  • CentOS 6.7系统下安装配置JDK的方法

    前言 本文是主要是记录CentOS 6.7系统下安装JDK7的过程记录,下面话不多说,来一起看看吧. 方法如下: 1.上Oracle官方下载最新的JDK安装包,为了方便安装建议下载rpm包 http://www.oracle.com/technetwork/java/javase/downloads/index.html 2.在服务器端执行安装 sudo rpm -ivh /目录/jdk-7-linux-x64.rpm 3.设置环境变量 这里我们需要找到profile文件,添加环境变量: #vi

  • CentOS安装jdk的三种方法

    环境 Linux版本:CentOS 6.5.Ubuntu 12.04.5 JDK版本:JDK 1.7 目录 方法一:手动解压JDK的压缩包,然后设置环境变量 方法二:用yum安装JDK 方法三:用rpm安装JDK 方法四:Ubuntu 上使用apt-get安装JDK 内容 方法一:手动解压JDK的压缩包,然后设置环境变量 1.在/usr/目录下创建java目录 [root@localhost ~]# mkdir/usr/java [root@localhost ~]# cd /usr/java

  • Centos6.5下Jdk+Tomcat+Mysql环境安装图文教程

    系统环境:Centos6.5 64位 一. 安装java环境 这里安装的是jdk1.7.60 在/usr/local目录下创建java目录,可到oracle官网或镜像网站下载jdk-7u60-linux-x64.tar.gz,放到/usr/local/java中, cd /usr/local/java,执行解压: tar zxvf  jdk-7u60-linux-x64.tar.gz. 解压完成后配置JAVA_HOME,JAR_HOME环境变量.打开/etc/profile文件,命令:vi /e

  • CentOS 下yum安装mysql、jdk和tomcat的方法

    0. 创建个人文件夹 # 使用 yum 安装tomcat 和 mysql # 创建文件夹 cd /usr/local mkdir hehe 1. 安装rzsz # 1. 安装rzsz yum list lrzsz* yum install lrzsz -y 2. 安装JDK,path之类的已经自动设置好了 # 2. 安装JDK yum list java* yum install java-1.7.0-openjdk* -y 3. 安装mysql # 3. 安装mysql yum list my

  • Hadoop2.X/YARN环境搭建--CentOS7.0 JDK配置

    Hadoop是Java写的,他无法使用Linux预安装的OpenJDK,因此安装hadoop前需要先安装JDK(1.6以上) 原材料:在Oracle官网下载的32位JDK: 说明: 1.CentOS 7.0系统现在只有64位的,但是,Hadoop一般支持32位的,在64位环境下有事会有Warning出现,避免真的有神马问题,选择i586的JDK(即32位的),当然,64位的CentOS 7 肯定是兼容32位JDK的,记住:64位系统肯定兼容32位的软件,32位系统不能兼容64位软件.64位只是说

  • CentOS 设置默认JDK步骤详解及命令

     CentOS下设置默认JDK 最近在弄Linux,用yum源安装opnjdk-devel版本后,用命令ll /etc/alternatives/Java查看,发现指向的是jre目录,而不是jdk,在此设置指向jdk目录. CentOS下设置默认JDK 执行命令: [root@exkPicture ~]# alternatives –install /usr/bin/Java java /usr/java/jdk1.7.0/bin/java 2 注意: alternatives的语法看这里 执行

  • Centos 64位安装aapt、jdk、tomcat的详细教程

    1.安装jdk #查看系统自带的jdk [root@localhost ~]# rpm -qa | grep jdk java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64 java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64 #卸载系统自带openjdk [root@localhost ~]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.

  • CentOS 7快速安装jdk

    CentOS 7下jdk安装过程,供大家参考,具体内容如下 查看系统版本 [root@zabbix ~]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) [root@zabbix ~]# uname -a Linux zabbix.com 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux 下载jd

  • CentOS 7系统下配置自定义JDK的教程

    前言 本文主要介绍的是关于CentOS 7配置自定义JDK的方法教程,分享出来供大家参考学习,下面来一起看看详细的介绍: 配置教程 由于选择的是CentOS 7-DVD镜像自带了OpenJDK,需要卸载.首先查询自带的JDK: rpm -qa | grep java 会出现7个带有java名称的东西,删除其中的带有OpenJDK字样的文件,命令如下: rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64 rpm -e --no

  • Linux centos7环境下jdk安装教程

    详解Linux centos7环境下安装JDK的步骤,供大家参考,具体内容如下 测试root用户下JAVA版本 输入命令:java –version 1.先到Oracle官网里下载好jdk,网址如下: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 2.把刚下载好的jdk上传到Linux系统里,这里我借助了一个工具WinSCP 3.然后把下载好的jdk包上传到software文

随机推荐