Установить java linux fedora

Java

  • If you came here because an application ask for Java (or JRE, JVM) to be installed, then simply install java-1.8.0-openjdk .
  • If it still does not work:
    • Install javafx and icedtea-web packages as well.
    • Lastly, and if the application ask specifically for Oracle Java: See here #Oracle_version.
  • If you want to develop, code, on the Java Platform: See Java/Development.

JRE JDK JVM JSE .

Some vocabulary, if you are lost:

  • JRE Java Runtime Environment. Required to run Java code and applications. Install java-1.8.0-openjdk .
  • JVM Java Virtual Machine. Main component of the JRE.
  • JDK Java Development Kit. Required only for development, coding.
  • SDK Software Development Kit. idem JDK
  • JavaWSJava Web Start is a framework to start application from the Internet
  • JavaFXJavaFX is a platform to create and deliver desktop and Rich Internet Apps.
  • OpenJFX is the JavaFX Open Source implementation
  • OpenJDK Open Source project behind the Java Platform http://openjdk.java.net/.
  • IcedTea is a support project for OpenJDK (concern only developers) http://icedtea.classpath.org/
  • IcedTea-Web is the Java Web Start package (It contains only JavaWS, No Applets anymore.) Install to run JNPL files.
  • Applets Obsolete techno. Not implemented in any recent package.
  • JSE, J2SE, JEE . obsolete acronyms for Java Standard & Enterprise Edition. JavaSE is like JRE.

What is in Java OpenJDK package

For most users, it is just another system library. It is not an application with a GUI, but it is required by some other applications to run. You might see a OpenJDK Policy tool desktop application that comes with the package, but you should not have to use it.

Beware that JavaFX and JavaWS are packaged separately!

Multiple implementations

Fedora provides the Free java-1.8.0-openjdk . If this Open Source stack does not fulfill your requirements. Alternatives can be installed alongside or separately.

The Java Community Process defines the specifications of the platform that many implements (IBM J9, Jikes, Zing, Zulu Dalvik . ). We will only focus on Oracle here.

Multiple implementations can be installed side-by-side without interfering:

  • The alternatives system allows to switch from one to another.
  • An application can directly reference a specific Java installation
  • Some applications include a java platform, it is then transparent for the user. (But the package is bigger.)

Oracle version

Some applications still ask for Oracle’s implementation. It is mostly based on the OpenJDK Open Source project, but there is proprietary code and Fedora does not package non-free software.

Читайте также:  Как в линуксе расшарить папку

Installing Oracle Java is fine. Just beware not to use Oracle RPM, as it will kill OpenJDK default packages!

We recommend to simply unpack the archives (tarball) to your home folder and set to path if necessary.

Switching alternatives

If you installed multiple Java implementations or version, you can configure your system to use one or another.

Developers: beware that javac has its own independent alternative. i.e. to change the JDK, use alternatives . javac!

Switching is done using the alternatives system (also used to change some other subsystems). Java’s subsystem name is surprisingly java and typical commands include:

# alternatives --display java

See alternative’s own documentation for more information for usage and parts involved.

Should be noted that JRE implementations installed outside Fedora distribution, may not support alternatives and thus not be visible there. Then the symbolic links under directory /etc/alternatives must be manually fixed.

Java packages in Fedora

You can use any of the following names:

  • java
  • java-1.8.0
  • java-1.8.0-openjdk
  • java-openjdk
  • jre
  • jre-1.8.0
  • jre-1.8.0-openjdk
  • jre-openjdk
dnf install java-1.8.0-openjdk

might be the most safe (until 1.8 is EOL.)

Note that Java Web Start (JavaWS) and JavaFX are packaged separately ‘icedtea-web’ and ‘javafx’ respectively.

Typically, without JavaFX, you may have error like:

java -jar scram.jar Error: Could not find or load main class com.frequal.scram.designer.jfx.Main
dnf install icedtea-web javafx

Communicate

You can subscribe to java-devel list or talk to us in #fedora-java Libera Chat IRC channel. Read Communicate page for more information.

See Also

Источник

How to Install Java on Fedora Linux

On top of that, you’ll come across OpenJDK and Oracle Java SE. OpenJDK is what is recommended because it is open source. If you have exclusive need then only you should go for Oracle Java SE.

There is one more thing here. Even OpenJDK has several versions available. At the time of writing this article, Fedora 34 has OpenJDK 1.8, OpenJDK 11 and OpenJDK 16 available.

It is up to you to decide which Java version you want.

Installing Java on Fedora Linux

First thing first, check if Java is already installed and which version it is. I am not kidding. Fedora usually comes with Java preinstalled.

To check, use the following command:

As you can see in the screenshot below, I have Java 11 (OpenJDK 11) installed on my Fedora system.

check java version fedora

Let’s say you want to install another version of Java. You may check the available options with the following command:

The sudo here is not required but it will refresh the metadata for sudo user which will eventually help when you install another version of Java.

The above command will show a huge output with plenty of similar looking packages. You have to focus on the initial few words to understand the different versions available.

available java versions fedora

For example, to install Java 8 (OpenJDK 1.8), the package name should be java-1.8.0-openjdk.x86_64 or java-1.8.0-openjdk. Use it to install it:

sudo dnf install java-1.8.0-openjdk.x86_64

install java fedora

That’s good. Now you have both Java 11 and Java 8 installed on your system. But how will you use one of them?

Читайте также:  Партнерский портал astra linux

Switch Java version on Fedora

Your Java version in use remains the same unless you explicitly change it. Use this command to list the installed Java versions on your system:

sudo alternatives --config java

You’ll notice a number before the Java versions. The + sign before the Java versions indicate the current Java version in use.

You can specify the number to switch the Java version. So, in the example below, if I enter 2, it will change the Java version on the system from Java 11 to Java 8.

Switching between installed Java versions

That’s all you need to do to install Java on Fedora.

Источник

How to Install Java 11/8 on Fedora

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.

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:

sudo dnf install java-11-openjdk 
sudo dnf install java-1.8.0-openjdk 
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.

Читайте также:  Virtualbox kernel driver not installed rc 1908 linux

Источник

How to Install Java in Fedora

Java is a general-purpose programming language that is fast, reliable, secure, popular and widely used. It is an environment to develop and run a wide range of applications, from mobile applications to desktop and web applications and enterprise systems – Java is everywhere!

If you are planning to create a program in Java, then you need to install a JDK (Java Development Kit). If you are planning to execute a Java program, you can do that on a JVM (Java Virtual Machine), which is included in the JRE (Java Runtime Environment). If in confusion, install the JDK because this is frequently needed even if the motive is not to create Java programs.

There are many flavors of Java out there and also many versions of each flavor. In this article, we will show you how to install both OpenJDK and Oracle JDK (Oracle Java SE) in Fedora.

Most Java applications run on one of the following:

  • OpenJDK — an open-source implementation of the Java Platform, Standard Edition
  • Oracle Java SE — a free JDK from Oracle

Important: Use the sudo command to gain root privileges while running commands in this article, if you are operating the system as a normal or administrative user.

Installing OpenJDK in Fedora

The package OpenJDK is available to install from the Fedora repository.

1. Run the following dnf command to search for the available versions.

Search OpenJDK Version in Fedora

2. Run the following command to install selected OpenJDK version.

$ sudo dnf install java-11-openjdk.x86_64

Install Java OpenJDK in Fedora

3. Next, run the following command to verify the version of Java installed on the system.

Verify Java Version in Fedora

Installing Oracle JDK in Fedora

To install Oracle Java SE:

1. Go to the Oracle Java SE downloads page. Then choose the version of Java you wish to use. To grab the latest version (Java SE 11.0.2 LTS), simply click the DOWNLOAD button as shown in the following image.

Oracle JDK Download

2. Accept the license agreement and download the appropriate RPM file for your systems architecture, for example jdk-11.0.2_linux-x64_bin.rpm for a 64 bit system.

Download Oracle JDK RPM Package

3. Once the download is complete, on the terminal, move to the Download directory and run the following command to install package.

$ sudo dnf install jdk-11.0.2_linux-x64_bin.rpm

Note: You might have installed several versions of Java on your system, you can switch from one version to another using the following command.

After running this command, you will see a a list of all installed Java versions, select the version you require.

$ sudo alternatives --config java $ java --version

Switch Java Version in Fedora

Java is a general-purpose programming language and environment to develop and run a wide range of programs. In this article, we showed how to install Java (OpenJDK and Oracle JDK) in Fedora. If you have any questions or comments, reach us through the feedback form below.

Источник

Оцените статью
Adblock
detector