Java runtime environment fedora

How to download and install prebuilt OpenJDK packages

Oracle’s OpenJDK JDK binaries for Windows, macOS, and Linux are available on release-specific pages of jdk.java.net as .tar.gz or .zip archives.

As an example, the archives for JDK 13 may be found on jdk.java.net/13 and may be extracted on the command line using

depending on the archive type.

JDK 8

Debian, Ubuntu, etc.

The openjdk-8-jre package contains just the Java Runtime Environment. If you want to develop Java programs then please install the openjdk-8-jdk package.

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

The java-1.8.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.8.0-openjdk-devel package.

JDK 7

Debian, Ubuntu, etc.

The openjdk-7-jre package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-7-jdk package.

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

The java-1.7.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.7.0-openjdk-devel package.

Читайте также:  An example HTMLDocument

JDK 6

Debian, Ubuntu, etc.

The openjdk-6-jre package contains just the Java Runtime Environment. If you want to develop Java programs then install the openjdk-6-jdk package.

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

The java-1.6.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.6.0-openjdk-devel package.

BSD Port

For a list of pointers to packages of the BSD Port for DragonFly BSD, FreeBSD, Mac OS X, NetBSD and OpenBSD, please see the BSD porting Project’s wiki page.

Источник

How to Install Oracle JRE on Fedora

Java is one of the most used programming languages. Due to its object-oriented nature, it is preferred by developers. Java can be used to develop Mobile, Desktop and Web-based applications. Java allows running java programs on many platforms with the help of JVM. JVM has a JRE or Java Run-time Environment that provides resources and class libraries to Java code for execution. JDK is only needed for developing Java applications.

What’s new in Java SE Release 8 for Linux

  • Support for configuration file along with command-line options for installation with cli. The configuration file-based installation has more options as compared to cli based installation.
  • Commands like java, javap, javac and javadoc can be used by users on the command line.
  • Java SE Release 8 users can now also verify which particular RPM package offers Java files.

What we will Cover

This post will explore Oracle JRE, and we will see how to install Oracle JRE on Fedora Linux using i) an archive binary file ii) an RPM binary file.

We also see how to uninstall JRE in both cases.

Oracle has different versions of JRE for Linux platforms based on system architecture. It is very important to download and install the version specific to your system. The following table shows different versions of Oracle JRE and the system architecture they are built for:

JRE Version System Architecture
jre-8u281-linux-x64.tar.gz 64 bit Linux
jre-8u281-linux-i586.tar.gz 32 bit Linux
jre-8u281-linux-x64.rpm 64 bit RPM based Linux
jre-8u281-linux-i586.rpm 32 bit RPM based Linux

Note: The above naming may change with time as it all depends on the JRE update version number

For this guide, we will be using

  1. “jre-8u281-linux-x64.tar.gz” which is actually an archive binary file.
  2. “jre-8u281-linux-x64.rpm” which is an RPM binary file.

So let’s get started with the installation of Oracle JRE.

Method 1. (a) Installation using archive binary file

Step 1. Open a web browser and go to Oracle JRE download page and download the archive binary file. This is shown below:

Review and accept the Oracle license agreement. It will now redirect you to the login page before downloading the file. You will need to create a new account with Oracle. If you already have an account, you can login directly.

Step 2. Once the file is downloaded, we can continue further. Beside the root user, any other user can also install the archive binary in any location. But for installing in system location root user is required. We will go to the file download directory and create a new directory as ‘lh-dir’ and move the archive binary to this folder.

# mv jre-8u281-linux-x64.tar.gz lh-dir/

This is shown in the screenshot below:

You can also use any other location where you would like to install JDK.

Step 3. Now we will unpack the downloaded archive binary in this new directory.

Sample Output:

Step 4. Now if you want, you can remove the archive binary (.tar.gz) file as below:

This will help us to save disk space.

Step 5. To start using JRE from anywhere on the system, we will specify our Java installation path in the /usr/bin directory. The /usr/bin directory contains executable commands on the system.

# update-alternatives —install «/usr/bin/java» «java» «/root/Downloads/lh-dir/jre1.8.0_281/bin/java» 1

Note: Please do not forget to change the name of the directory ‘lh-dir’ to the one you have created.

Step 6. Once we have specified the java path, we can use the java command from anywhere on the system. Let’s check the java version from the documents folder.

The following screenshot demonstrates this:

To Check the PATH Variable for the JRE, run the following command:

It will produce output like

(b) Uninstalling Oracle JRE

In case you would like to remove the Oracle JRE from your system, you will need to follow the steps below:

Step 1. Remove all link for the alternatives by running the following command:

Please do not forget to change the java file’s location in the above command with your system’s one.

Step 2. Verify if the Oracle JRE has been removed with the below command:

It should say: bash: /usr/bin/java: No such file or directory

Method 2. (a) Installation using the RPM binary file

Step 1. Now again go to the Oracle JRE download page and this time download the 64-bit rpm file as shown below:

Note: Make sure that before installing the rpm file you have removed the old JDK installation packages.

Step 2. After you have downloaded the file, open a terminal and get root access. Go to the folder containing the rpm file. Now run the following command:

The above command will install the JRE rpm file, as shown below:

Step 3. Now again check the version of java from any directory, it will show the following output:

(b) Uninstalling Oracle JRE

Step 1. First, check the installed package of JRE from the following command:

It will show the corresponding jre package:

Step 2. Now uninstall the JRE package with the following command:

Step 3. Now again check the version of java, this time it should show:

Conclusion

In this guide, we have learned how we can install Oracle JRE on Fedora Linux. We have also seen how it can be uninstalled from the system. This guide was successfully tested on Fedora 33 Linux. Since we have installed JRE with .tar.gz file in Method 1, the installation steps will remain the same for all 64 bit Linux distributions. The same steps should be used for installing Oracle JRE for 32 bit Linux. The only thing to change here is to use the 32-bit version of JRE.

Method 2 is comparatively easy for installing and removing Oracle JRE. The same method should also work on 32-bit Linux by installing the 32-bit version of JRE.

About the author

Ali Imran Nagori

Ali imran is a technical writer and Linux enthusiast who loves to write about Linux system administration and related technologies. You can connect with him on LinkedIn
.

Источник

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.

Источник

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