-
Language:
English
-
Language:
English
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/java
or/usr/lib/jvm/java-1.7.0-openjdk/bin/java
.