Follow these instructions to install a Java Development Kit (JDK) on Red Hat Enterprise Linux using Red Hat Network (RHN).

If you have difficulties performing the installation using RHN please refer to the RHN Help Desk at https://rhn.redhat.com/rhn/help/ or contact Red Hat Support directly for assistance.

Important

The following procedure require that the commands be run with administrator privileges. This means running the commands using the sudo command, logging in as the root user, or by switching to the root user with the su command.

A.1. OpenJDK on Red Hat Enterprise Linux 5

Use this procedure to install OpenJDK on Red Hat Enterprise Linux 5.

Procedure A.1. Installing OpenJDK on Red Hat Enterprise Linux 5

Subscribe to the base channel

The OpenJDK is available in the RHN base channel. By default, all installations of Red Hat Enterprise Linux are subscribed to this channel.

A.4. Setting the Default JDK with the alternatives Utility

alternatives is a tool for managing different software packages that provide the same functionality. Red Hat Enterprise Linux uses alternatives to ensure that only one Java Development Kit (JDK) is set as default at a time.

Installing a JDK from Red Hat Network will normally result in an automatically configured system. However, if you have installed multiple JDKs it is possible that there may be conflicts. Perform the following steps to verify that the everything is set up correctly.

Example A.1. Using alternatives to Configure the Default Java Development Kit