Chapter 4. Updating OpenJDK 8 on RHEL

The following sections provide instructions for updating OpenJDK 8 on RHEL.

4.1. Updating OpenJDK 8 on RHEL by using yum

The installed OpenJDK packages can be updated using the yum system package manager.


  • You must have root privileges on the system.


  1. Check the current OpenJDK version:

    $ sudo yum list installed "java*"

    A list of installed OpenJDK packages displays.

    Installed Packages
    java-1.8.0-openjdk.x86_64   1:    @rhel-8-for-x86_64-appstream-rpms
    java-11-openjdk.x86_64    1:    @rhel-8-for-x86_64-appstream-rpms
    java-17-openjdk.x86_64    1:    @rhel-8-for-x86_64-appstream-rpms
  2. Update a specific package. For example:

    $ sudo yum update java-1.8.0-openjdk
  3. Verify that the update worked by checking the current OpenJDK versions:

    $ java -version
    openjdk version "1.8.0_322"
    OpenJDK Runtime Environment (build 1.8.0_322-b06)
    OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)

    If the output from the previous command shows that you have a different major version of OpenJDK checked out on your system, you can enter the following command in your CLI to switch your system to use OpenJDK 8:

    $ sudo update-alternatives --config 'java'

4.2. Updating OpenJDK 8 on RHEL by using an archive

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


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


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

    For example:

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

Additional resources

Revised on 2022-03-14 16:59:12 UTC