Search

Chapter 4. Updating Red Hat build of OpenJDK 21 on Red Hat Enterprise Linux

download PDF

The following sections provide instructions for updating Red Hat build of OpenJDK 21 on Red Hat Enterprise Linux.

4.1. Updating Red Hat build of OpenJDK 21 on RHEL by using yum

The installed Red Hat build of OpenJDK packages can be updated using the yum system package manager.

Prerequisites

  • You must have root privileges on the system.

Procedure

  1. Check the current Red Hat build of OpenJDK version:

    $ sudo yum list installed "java*"

    A list of installed Red Hat build of OpenJDK packages displays.

  2. Update a specific package. For example:

    $ sudo yum update java-21-openjdk
  3. Verify that the update worked by checking the current Red Hat build of OpenJDK versions:

    $ java -version
    Note

    You can install multiple major versions of Red Hat build of OpenJDK on your local system. If you need to switch from one major version to another major version, issue the following command in your command-line interface (CLI) and then follow the onscreen prompts:

    $ sudo update-alternatives --config 'java'

4.2. Updating Red Hat build of OpenJDK 21 on RHEL by using an archive

You can update Red Hat build of OpenJDK using the archive. This is useful if the Red Hat build of OpenJDK administrator does not have root privileges.

Prerequisites

  • Know the generic path pointing to your JDK or JRE installation. For example, ~/jdks/java-21

Procedure

  1. Remove the existing symbolic link of the generic path to your JDK or JRE.

    For example:

    $ unlink ~/jdks/java-21
  2. Install the latest version of the JDK or JRE in your installation location.

Additional resources

Revised on 2024-05-09 14:54:00 UTC

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.