This tutorial is written for the instructions to install the Latest Java version on Fedora, CentOS, and Redhat systems. So, follow this article to install Java 19 on your Fedora and CentOS/RHEL systems.

Step 1 – Download Java 19

Download the latest Java SE Development Kit 19 non-LTS release from its official download page or use following commands to download from the command line.

Step 2 – Install Latest Java on Fedora & CentOS

After downloading the Java package file, use the rpm command to install it on your system. The non-root user must use sudo run command with special privileges that allow the installation. Execute the following command to install Java 19: Once the installation is completed, this version will be the default Java version. But in case the system is still using the older version, use alternatives command to change the default Java version. The alternatives binary is provided by chkconfig package. According to the above screenshot, there are 2 versions installed. Java 19 is listed on number 2, So input numeric 2 and press Enter. This will change the default Java version to 19 on your system.

Step 3 – Check Default Java Version

Check the installed Java version on your system using the following command.

Step 4 – Setup Java Environment Variables

Most Java-based applications use environment variables to work. Set the Java environment variables using the following commands

Setup JAVA_HOME Variable

Also, put all the above environment variables in /etc/environment file for auto-loading on system boot.

Conclusion

This tutorial helped you to install Java 19 on Fedora 37/36/35 and CentOS/RHEL 8/7 Linux systems.