How to install java-1.7.0-openjdk-devel on RHEL Server 6.3?

I have need of installing a Java 7 development environment on a RHEL 6.3 (system details are below). Following the official OpenJDK directions I tried yum install java-1.7.0-openjdk-devel (as root). This yields the error message:

No package java-1.7.0-openjdk-devel available.

The Java6 JDK java-1.6.0-openjdk-devel and the Java7 JRE java-1.7.0-openjdk are both available, but the Java7 JDK does not appear.

Is there a non-default repository from which I can install this? If so what is it?

  • Distribution: Red Hat Enterprise Linux Server release 6.3 (Santiago)
  • Kernel: 2.6.32-279.5.2.el6.x86_64

The package you are looking for is in the Red Hat Enterprise Linux Server Optional channel which may not be enabled.

Try this:

# yum repolist all
# yum-config-manager --enable rhel-6-server-optional-rpms

I removed the -devel and it worked:

yum install java-1.7.0-openjdk

If you already have another java version installed, don't forget to configure the system so that the new version will be used:

alternatives --config java