> For the complete documentation index, see [llms.txt](https://docs.ovaledge.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ovaledge.com/deployment-and-maintenance/installation/java21-installation-on-rhel.md).

# Java21 Installation on RHEL

This article describes the steps required to install Java 21 (OpenJDK) on a Red Hat Enterprise Linux (RHEL) system. The procedure ensures that the required Java runtime is installed and verified for use with OvalEdge components.

The steps apply to RHEL 7, RHEL 8, and RHEL 9 environments with minor variations in package management commands.

## Prerequisites

Ensure the following before proceeding:

* Access to a RHEL 7, RHEL 8, or RHEL 9 machine
* Root or sudo privileges
* Internet connectivity to download packages from repositories

## Steps Involved

1. Update System Packages
   * Run the appropriate command to update system packages:
     * For RHEL 8 and RHEL 9:

       ```
       sudo dnf update -y
       ```
     * For RHEL 7:

       ```
       sudo yum update -y
       ```
2. Install Java 21 (OpenJDK)
   * For RHEL 8 and RHEL 9:

     ```
     sudo dnf install java-21-openjdk java-21-openjdk-devel -y
     ```
   * For RHEL 7:

     ```
     sudo yum install java-21-openjdk-devel -y
     ```
3. Verify Installation
   * Run the following command to verify the installation:

     ```
     java -version
     ```
   * Expected output:

     ```
     openjdk version "21.x.x"
     ```

     \
     Sample Reference Screenshot:

     <figure><img src="https://content.gitbook.com/content/gnJyYKHzsnoFOdZJtHsc/blobs/JvT75EQkTGuWgevLPZh7/unknown.png" alt=""><figcaption></figcaption></figure>

***

Copyright © 2026, OvalEdge LLC, Peachtree Corners, GA, USA.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ovaledge.com/deployment-and-maintenance/installation/java21-installation-on-rhel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
