Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»JAVA»How to Install Java 11/8 on Fedora

    How to Install Java 11/8 on Fedora

    By RahulJune 13, 20212 Mins Read

    Java is a popular programming language for the application, system software, and web applications. The Oracle Java 8 and Java 11 required a subscription to download and use it. So we use OpenJDK for this installation of Java on the Fedora Linux system.

    Advertisement

    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.

    sudo dnf search openjdk 
    

    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:

    java -version 
    
    openjdk version "1.8.0_242"
    OpenJDK Runtime Environment (build 1.8.0_242-b08)
    OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
    

    Step 4 – Switch Between Java Versions

    You can use the alternatives command to switch between multiple Java versions installed on your Fedora Linux systems.

    sudo alternatives --config java 
    

    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.

    Install and Switch Java on Fedora

    After change again check the current active Java version.

    java -version 
    
    openjdk version "11.0.11" 2021-04-20
    OpenJDK Runtime Environment 18.9 (build 11.0.11+9)
    OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9, mixed mode, sharing)
    

    Conclusion

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

    install java Java Java 11 java 8 openjdk
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Set JAVA_HOME environment variable on macOS

    How to Set JAVA_HOME environment variable on macOS

    What is the Access Modifiers in Java

    What are the Access Modifiers in Java

    Installing Java on Ubuntu 22.04

    How to Install JAVA on Ubuntu 22.04

    View 6 Comments

    6 Comments

    1. SINA on October 2, 2021 11:50 am

      What is the following error:

      Error:
      Problem: conflicting requests
      – nothing provides /bin/basename needed by jdk-14.0.2-2000:14.0.2-ga.x86_64
      – nothing provides /bin/cp needed by jdk-14.0.2-2000:14.0.2-ga.x86_64
      – nothing provides /bin/ls needed by jdk-14.0.2-2000:14.0.2-ga.x86_64
      – nothing provides /bin/mkdir needed by jdk-14.0.2-2000:14.0.2-ga.x86_64
      – nothing provides /bin/mv needed by jdk-14.0.2-2000:14.0.2-ga.x86_64
      – nothing provides /bin/pwd needed by jdk-14.0.2-2000:14.0.2-ga.x86_64
      – nothing provides /bin/sort needed by jdk-14.0.2-2000:14.0.2-ga.x86_64
      (try to add ‘–skip-broken’ to skip uninstallable packages)

      Reply
    2. Jeffersonian on November 11, 2020 12:56 pm

      Very useful, thanks.

      Incidentally:
      Jitsi for Fedora (33) does not work with (off the box) Java 11… but work with java 1.8.0
      So here is the solution.

      Reply
    3. jesus on June 29, 2020 12:01 am

      Tanks a lot!

      Reply
    4. Venni on June 25, 2020 5:00 pm

      Thanks it was easy 🙂

      Reply
    5. Ricardo assis on February 20, 2020 12:51 am

      Tanks a lot!

      Reply
    6. Marcin on February 19, 2020 6:19 am

      Wonderful Rahul, it worked! Thanks!!!

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    • sleep Command in Linux with Examples
    • 20 Basic Linux Commands for the Beginners (Recommended)
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.