×


How to Install Java 17, 11, or 8 LTS on Fedora Linux ?

Java is a popular programming language used for developing applications. It is used in a variety of applications from web development to enterprise applications. It is a platform independent language, which means it can run on any system with a Java Virtual Machine (JVM) installed. Java is maintained by Oracle and there are different versions of Java available. The most popular versions are Java 8, 11, and 17.

Here at Ibmi Media, we will show you how to install Java 17, 11, and 8 LTS on Fedora Linux. 


Prerequisites 

Before you begin this guide, you should have:

  • A regular, non-root user with sudo privileges configured on your system.
  • An internet access to download the Java packages.


1. Update Fedora 

It is recommended to update your Fedora system before installing any new packages. You can update your system by running the following command:

$ sudo dnf update

When prompted, type y and press Enter to confirm the updates.


2. Install Java 17 LTS 

The latest version of Java is Java 17 LTS. To install this version, run the following command:

$ sudo dnf install java-17-openjdk


3. Install Java 11 LTS 

If you need to install Java 11 LTS, run the following command:

$ sudo dnf install java-11-openjdk


4. Install Java 8 LTS 

If you need to install Java 8 LTS, run the following command:

$ sudo dnf install java-1.8.0-openjdk


How to Switch Java Versions on Fedora ?

If you need to switch between different versions of Java, you can use the alternatives command. This command allows you to select a default version of Java to use. 

To switch to Java 17 LTS, run the following command:

$ sudo alternatives --config java

This command will list the available Java versions. Select the number corresponding to Java 17 LTS and press Enter.


[ Need Fedora Linux Support? Contact us now. ]


Conclusion

This tutorial covers how to install Java 17, 11, and 8 LTS on Fedora Linux. We have also explained how to update Fedora, install Java 17 LTS, install Java 11 LTS, install Java 8 LTS, and switch between Java versions. We hope this tutorial was helpful.