> 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/release8.3/deployment-and-maintenance/upgrade/java21-upgrade-linux.md).

# Java21 Upgrade (Linux)

This article describes the steps to upgrade Java to version 21 on a Linux machine. It outlines the installation process, configuration updates, and validation steps required to ensure the system uses the correct Java version. The procedure follows a structured approach aligned with standard deployment practices.

## Prerequisites

* Linux-based system with root or sudo access
* Access to a package manager (e.g., yum)
* Existing Java installation on the system
* Terminal or command-line access

## Steps Involved

### Verify Existing Java Version

* Run the following command to check the currently installed Java version:

  ```
  java -version
  ```

  \
  Sample Reference Screenshot:

  <figure><img src="https://content.gitbook.com/content/8fgltewNgYZ8ucAp7Svt/blobs/WiB3JLDkeveTl0QJMp73/unknown.png" alt=""><figcaption></figcaption></figure>

### Install Java 21

* Execute the following command to install Java 21:

  ```
  sudo yum install java-21-openjdk-devel -y
  ```

  \
  Sample Reference Screenshot:

  <figure><img src="https://content.gitbook.com/content/8fgltewNgYZ8ucAp7Svt/blobs/nuB9RRjvEaRDdXty9kuk/unknown.png" alt=""><figcaption></figcaption></figure>

### Configure Java Alternatives

* Run the following command to list and configure available Java versions:&#x20;

  ```
  sudo update-alternatives --config java
  ```
* From the displayed list, select Java 21 by entering the corresponding number, then press Enter.\
  \
  Sample Reference Screenshot:

  <figure><img src="https://content.gitbook.com/content/8fgltewNgYZ8ucAp7Svt/blobs/qlAFcnIzYxkMJqly6vS3/unknown.png" alt=""><figcaption></figcaption></figure>

### Validate Java Upgrade

* Verify that the system is using Java 21 by running:

  ```
  java -version
  ```

  \
  Sample Reference Screenshot:

  <figure><img src="https://content.gitbook.com/content/8fgltewNgYZ8ucAp7Svt/blobs/Ao8APDUboGKwZEkHoEbr/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/release8.3/deployment-and-maintenance/upgrade/java21-upgrade-linux.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.
