Chapter 4. Updating Red Hat build of OpenJDK 21 on Red Hat Enterprise Linux
Chapter 4. Updating Red Hat build of OpenJDK 21 on Red Hat Enterprise Linux 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 You can update the installed Red Hat build of OpenJDK packages by using the yum system package manager. Prerequisites You must have root privileges on the system. Procedure Check the current Red Hat build of OpenJDK version: A list of installed Red Hat build of OpenJDK packages displays. Update a specific package. For example: Verify that the update worked by checking the current Red Hat build of OpenJDK versions: 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: 4.2. Updating Red Hat build of OpenJDK 21 on RHEL by using an archive You can update Red Hat build of OpenJDK by using an archive file. 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 Remove the existing symbolic link of the generic path to your JDK or JRE. For example: Install the latest version of the JDK or JRE in your installation location. Additional resources For instructions on installing a JRE, see Installing a JRE on RHEL by using an archive . For instructions on installing a JDK, see Installing Red Hat build of OpenJDK on RHEL by using an archive . Revised on 2024-11-19 12:33:15 UTC
sudo yum list installed "java*" sudo yum update java-21-openjdk java -version sudo update-alternatives --config 'java' unlink ~/jdks/java-21