Show Table of Contents
Chapter 2. Installing Prerequisite Components
2.1. Install Open JDK on Red Hat Enterprise Linux
- Install the OpenJDK package:
yum install java-[VERSION]-openjdk-devel
- To install it to alternatives, run these commands:
sudo alternatives --install /usr/bin/java java usr/lib/jvm/java-[VERSION]-openjdk/bin/java 1000
sudo alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-[VERSION]-openjdk/bin/javac 1000
- As root, run the alternatives command for
java:/usr/sbin/alternatives --config java
- Select
/usr/lib/jvm/jre-[VERSION]-openjdk/bin/java. - Then do the same for
javac:/usr/sbin/alternatives --config javac
- Select
/usr/lib/jvm/java-[VERSION]-openjdk/bin/javac.

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.