Menu
User

DropVPS Team

Writer: John hens

how to install java on redhat 9

how to install java on redhat 9

Publication Date

09/17/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Java is one of the most essential runtimes for developers, sysadmins, and security professionals. Many enterprise tools and applications require it, and on Red Hat Enterprise Linux 9 (RHEL 9), you can install it easily with a few commands. 

Step 1: Update System Packages

Before installing Java, make sure your RHEL 9 system is fully updated. This ensures compatibility and avoids broken dependencies. Run the following commands:  

sudo dnf update -y
sudo dnf upgrade -y

Keeping your system fresh also gives you the latest stable repositories for Java.

Step 2: Install Java Runtime Environment (JRE)

If you only need Java to run applications, the Java Runtime Environment (JRE) is enough. RHEL 9 provides OpenJDK packages for easy installation:

sudo dnf install java-17-openjdk -y

This will install OpenJDK 17, which is the default and recommended version on Red Hat 9 in 2025.

Step 3: Install Java Development Kit (JDK)

If you plan to compile or develop Java applications, you need the Java Development Kit (JDK). It includes the JRE plus developer tools like javac:

sudo dnf install java-17-openjdk-devel -y

With this package, you’re ready to build and run Java applications on RHEL 9.

Step 4: Verify the Java Installation

After installation, check if Java is installed correctly by verifying the version. Use the following commands:

java -version
javac -version

If both commands return version numbers, Java is successfully installed on your Red Hat Enterprise Linux 9 system.

Linux VPS
U
Loading...

Related Posts