> 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.2/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="/files/jKUdsg4YGCqqbZO9rZOu" 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="/files/jkjo0In9W5Ba6FZQTOtQ" 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="/files/P0FuovAs38KMzD1VemmF" 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="/files/su6ZkGAKidyBpCiqROJ5" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ovaledge.com/release8.2/deployment-and-maintenance/upgrade/java21-upgrade-linux.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
