This tutorial will help to install Java on Fedora Linux. Let’s follow the below simple steps for the installation.

Step 1 – Search Java Packages

The OpenJDK rpm packages are available under the AppStream repository. Use the following command to search available Java packages under configured DNF repositories.

Step 2 – Install Java on Fedora

Now, use one of the following commands to install the required Java version on your Fedora Linux system. You can also install the both Java version on any system and use as per your requirements. Choose one of the below commands to install required Java version on Fedora:

Install Java 11 on Fedora:sudo dnf install java-11-openjdk Installing Java 8 on Fedora:sudo dnf install java-1.8.0-openjdk Install Latest Java on Fedora:sudo dnf install java-latest-openjdk

You can also install multiple or all versions of Java on a Fedora system. In the next steps, we have provides you instructions to switch between the Java versions on Fedora Linux.

Step 3 – Check Java Version

I have installed both Java versions for this article, First I have installed Java 11 then installed Java 8 on my Fedora system. Let’s check the installed and current active Java version on your system using the following command:

Step 4 – Switch Between Java Versions

You can use the alternatives command to switch between multiple Java versions installed on your Fedora Linux systems. A list of installed Java versions will be displayed. Select the appropriate Java version number and press enter. In my case, Java 8 is currently active so I entered 1 in selection to change it to Java 11.

After change again check the current active Java version.

Conclusion

In this tutorial, you have learned to install Java on Fedora Linux systems.

How to Install Java 11 8 on Fedora   TecAdmin - 84