HostOnNet Blog

Installing Java on CentOs

Looking for Linux Server Admin or WordPress Expert? We can help.

Java is available in CentOS 5.

root@server70 [~]# yum list|grep openjdk
java-1.6.0-openjdk.x86_64                  1:       installed
java-1.6.0-openjdk-demo.x86_64             1:       updates
java-1.6.0-openjdk-devel.x86_64            1:       updates
java-1.6.0-openjdk-javadoc.x86_64          1:       updates
java-1.6.0-openjdk-src.x86_64              1:       updates
root@server70 [~]#

To install java, run

yum install java-1.6.0-openjdk

Java will be installed on

root@server70 [/var/log]# rpm -q --filesbypkg java-1.6.0-openjdk  | grep "/bin/java"
java-1.6.0-openjdk        /usr/lib/jvm/java-1.6.0-openjdk-
root@server70 [/var/log]# which java
root@server70 [/var/log]# cd /usr/bin
root@server70 [/usr/bin]# ls -la |grep java
lrwxrwxrwx  1 root root          22 Aug 25 02:56 java -> /etc/alternatives/java*
root@server70 [/usr/bin]# ls -la /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Aug 25 02:56 /etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java*
root@server70 [/usr/bin]#

Posted in Linux

2 Responses to Installing Java on CentOs

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.