How to Install Java in CentOS 6.3


Install Java in CentOS

Create a Local Repository for CentOS by using existing packages on Distribution Media or make sure that Internet is accessible from the virtual machine

Cloud Computing – Download Free EBooks and Whitepapers
Java – Download Free EBooks and Whitepapers
Windows – Download Free EBooks and Whitepapers

List of all available JDK on the system

[root@localhost ~]# yum search java | grep -i –color JDK
ldapjdk-javadoc.x86_64 : Javadoc for ldapjdk
icedtea-web.x86_64 : Additional Java components for OpenJDK – Java browser
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
ldapjdk.x86_64 : The Mozilla LDAP Java SDK

[root@localhost ~]# yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: centosmirror.go4hosting.in
* extras: centosmirror.go4hosting.in
* updates: centosmirror.go4hosting.in
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package java-1.7.0-openjdk.x86_64 1:1.7.0.55-2.4.7.1.el6_5 will be installe                                                                                        d
–> Processing Dependency: jpackage-utils >= 1.7.3-1jpp.2 for package: 1:java-1.                                                                                        7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64
–> Processing Dependency: xorg-x11-fonts-Type1 for package: 1:java-1.7.0-openjd                                                                                        k-1.7.0.55-2.4.7.1.el6_5.x86_64
–> Processing Dependency: tzdata-java for package: 1:java-1.7.0-openjdk-1.7.0.5                                                                                        5-2.4.7.1.el6_5.x86_64
–> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: 1:java                                                                                        -1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64
–> Processing Dependency: libgif.so.4()(64bit) for package: 1:java-1.7.0-openjd                                                                                        k-1.7.0.55-2.4.7.1.el6_5.x86_64
—> Package java-1.7.0-openjdk-devel.x86_64 1:1.7.0.55-2.4.7.1.el6_5 will be in                                                                                        stalled
–> Running transaction check
—> Package giflib.x86_64 0:4.1.6-3.1.el6 will be installed
—> Package jpackage-utils.noarch 0:1.7.5-3.12.el6 will be installed
—> Package libjpeg.x86_64 0:6b-46.el6 will be obsoleted
—> Package libjpeg-turbo.x86_64 0:1.2.1-3.el6_5 will be obsoleting
—> Package tzdata-java.noarch 0:2014b-1.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.el                                                                                        6.noarch
–> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-9.1.el                                                                                        6.noarch
–> Running transaction check
—> Package ttmkfdir.x86_64 0:3.0.9-32.1.el6 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.55-2.4.7.1.el6_5   updates    26 M
java-1.7.0-openjdk-devel   x86_64   1:1.7.0.55-2.4.7.1.el6_5   updates   9.4 M
libjpeg-turbo              x86_64   1.2.1-3.el6_5              updates   174 k
replacing  libjpeg.x86_64 6b-46.el6
Installing for dependencies:
giflib                     x86_64   4.1.6-3.1.el6              base       37 k
jpackage-utils             noarch   1.7.5-3.12.el6             base       59 k
ttmkfdir                   x86_64   3.0.9-32.1.el6             base       43 k
tzdata-java                noarch   2014b-1.el6                updates   147 k
xorg-x11-fonts-Type1       noarch   7.2-9.1.el6                base      520 k

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

Total download size: 36 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): giflib-4.1.6-3.1.el6.x86_64.rpm                   |  37 kB     00:01
(2/8): java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64. |  26 MB     18:30
(3/8): java-1.7.0-openjdk-devel-1.7.0.55-2.4.7.1.el6_5.x86_64.rpm                                                                                | 9.4 MB     07:02
(4/8): jpackage-utils-1.7.5-3.12.el6.noarch.rpm                                                                                                  |  59 kB     00:00
(5/8): libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm                                                                                                    | 174 kB     00:09
(6/8): ttmkfdir-3.0.9-32.1.el6.x86_64.rpm                                                                                                        |  43 kB     00:01
(7/8): tzdata-java-2014b-1.el6.noarch.rpm                                                                                                        | 147 kB     00:05
(8/8): xorg-x11-fonts-Type1-7.2-9.1.el6.noarch.rpm                                                                                               | 520 kB     00:16
————————————————————————————————————————————————————————
Total                                                                                                                                    23 kB/s |  36 MB     26:19
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : jpackage-utils-1.7.5-3.12.el6.noarch                                                                                                                 1/9
Installing : giflib-4.1.6-3.1.el6.x86_64                                                                                                                          2/9
Installing : libjpeg-turbo-1.2.1-3.el6_5.x86_64                                                                                                                   3/9
Installing : tzdata-java-2014b-1.el6.noarch                                                                                                                       4/9
Installing : ttmkfdir-3.0.9-32.1.el6.x86_64                                                                                                                       5/9
Installing : xorg-x11-fonts-Type1-7.2-9.1.el6.noarch                                                                                                              6/9
Installing : 1:java-1.7.0-openjdk-devel-1.7.0.55-2.4.7.1.el6_5.x86_64                                                                                             7/9
Installing : 1:java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64                                                                                                   8/9
Erasing    : libjpeg-6b-46.el6.x86_64                                                                                                                             9/9
Verifying  : ttmkfdir-3.0.9-32.1.el6.x86_64                                                                                                                       1/9
Verifying  : xorg-x11-fonts-Type1-7.2-9.1.el6.noarch                                                                                                              2/9
Verifying  : 1:java-1.7.0-openjdk-devel-1.7.0.55-2.4.7.1.el6_5.x86_64                                                                                             3/9
Verifying  : tzdata-java-2014b-1.el6.noarch                                                                                                                       4/9
Verifying  : libjpeg-turbo-1.2.1-3.el6_5.x86_64                                                                                                                   5/9
Verifying  : giflib-4.1.6-3.1.el6.x86_64                                                                                                                          6/9
Verifying  : 1:java-1.7.0-openjdk-1.7.0.55-2.4.7.1.el6_5.x86_64                                                                                                   7/9
Verifying  : jpackage-utils-1.7.5-3.12.el6.noarch                                                                                                                 8/9
Verifying  : libjpeg-6b-46.el6.x86_64                                                                                                                             9/9

Installed:
java-1.7.0-openjdk.x86_64 1:1.7.0.55-2.4.7.1.el6_5        java-1.7.0-openjdk-devel.x86_64 1:1.7.0.55-2.4.7.1.el6_5        libjpeg-turbo.x86_64 0:1.2.1-3.el6_5

Dependency Installed:
giflib.x86_64 0:4.1.6-3.1.el6                  jpackage-utils.noarch 0:1.7.5-3.12.el6      ttmkfdir.x86_64 0:3.0.9-32.1.el6      tzdata-java.noarch 0:2014b-1.el6
xorg-x11-fonts-Type1.noarch 0:7.2-9.1.el6

Replaced:
libjpeg.x86_64 0:6b-46.el6

Complete!
You have mail in /var/spool/mail/root
[root@localhost ~]#

RHEL and CentOS Linux install OpenJDK into /usr/lib/jvm/ directory

Set the JAVA_HOME class path variable

export JAVA_HOME="/usr/lib/jvm/jre-1.7.0-openjdk.x86_64

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s