Show Table of Contents
2.3. Install OpenJDK on Red Hat Enterprise Linux
Procedure 2.1. Install OpenJDK on Red Hat Enterprise Linux
Subscribe to the Base Channel
Obtain the OpenJDK from the RHN base channel. Your installation of Red Hat Enterprise Linux is subscribed to this channel by default.Install the Package
Use the yum utility to install OpenJDK:$ sudo yum install java-1.6.0-openjdk-devel
Verify that OpenJDK is the System Default
Ensure that the correct JDK is set as the system default as follows:- Log in as a user with root privileges and run the alternatives command:
$ /usr/sbin/alternatives --config java
- Depending on the OpenJDK version, select
/usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java. - Use the following command to set
javac:$ /usr/sbin/alternatives --config javac
- Depending on the OpenJDK version used, select
/usr/lib/jvm/java-1.6.0-openjdk/bin/javaor/usr/lib/jvm/java-1.7.0-openjdk/bin/java.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.