Installing Java 1.6 (OpenJDK) in CentOS 5.x from EPEL

I am posting this mini guide for those needing a quick guide in installing OpenJDK in CentOS 5.x.

The how-to information in CentOS community wiki sites explains how to build the rpms yourself from various JDK providers (IBM, Sun/Oracle, etc); but this is not what I wanted. What I wanted is to leverage existing yum repositories for CentOS, and this is where EPEL (Extra Packages for Enterprise Linux) comes to mind.

Requirements:

  • CentOS 5.x – this guide has been tested against 5.2
  • root access
  • yum

Add EPEL to your yum repositories:


cd /tmp && wget -c http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm

Install OpenJDK


yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel

Check java and javac versions


java -version
javac -version

You’re done!

Advertisements

2 thoughts on “Installing Java 1.6 (OpenJDK) in CentOS 5.x from EPEL

  1. what to do if your system can’t see it ?

    I tried something with update alternatives, then removed everything and reinstalled java-1.6.0-openjdk but now my CentOS box can’t see any java …

Leave a Reply

Please log in using one of these methods to post your comment:

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