How to Install Java JDK/JRE 17/11/8 on Fedora 35 / 34 – Holhol24

12

The Java JDK (Java Development Kit) is a device construction atmosphere used for creating Java Applications. It is a number of programming equipment, significantly JRE (Java Runtime Environment), Java (Loader for Java Application), Javac (Compiler), Jar (Archiver), and so on.

Java JRE (Java Runtime Environment) comprises equipment for operating Java programs.

OpenJDK is an open-source implementation of the Oracle Java SE platform version, and there is not any technical distinction between OpenJDK and Oracle JDK.

Here, we can see find out how to set up Java JDK/JRE 17/11/8 on Fedora 35.

Install Java on Fedora 35

You can set up OpenJDK or Oracle Java as in line with your requirement. You too can have a couple of variations of Java (OpenJDK and Oracle Java) for your machine.

Install OpenJDK

Installing OpenJDK is a lovely simple procedure in Fedora. You can use the dnf command to put in OpenJDK.

Install OpenJDK JDK

# Java JDK 17

sudo dnf set up -y java-17-openjdk-devel

# Java JDK 11

sudo dnf set up -y java-11-openjdk-devel

# Java JDK 8

sudo dnf set up -y java-1.8.0-openjdk-devel

Install OpenJDK JRE

# Java JRE 17

sudo dnf set up -y java-17-openjdk

# Java JRE 11

sudo dnf set up -y java-11-openjdk

# Java JRE 8

sudo dnf set up -y java-1.8.0-openjdk

Install Oracle Java

There isn’t any separate JRE (Java Runtime Environment) anymore. Instead, Oracle JDK now supplies JRE as neatly.

Download Oracle Java JDK

You can both use the command line or browser to obtain the JDK.

Go to the Oracle JDK web page to obtain programs the usage of the browser. Then, obtain the rpm binary package deal for simple set up.

Oracle Java JDK 17 (LTS):

Download Oracle Java 17 (v17.0.1)

Oracle Java JDK 11 (LTS):

Download Oracle Java 11 (v11.0.13) (Login Required)

Oracle Java JDK 8:

Download Oracle Java 8 (v8u311) (Login Required)

If you continue to need to obtain throughout the command line, set up the wget package deal.

sudo dnf set up -y wget

Then, use the beneath command to obtain Oracle Java the usage of the terminal.

# Oracle Java JDK 17

wget https://obtain.oracle.com/java/17/recent/jdk-17_linux-x64_bin.rpm

# Oracle Java JDK 11



# Oracle Java JDK 8

Install Oracle Java JDK

After downloading the package deal, set up Oracle Java JDK the usage of the rpm command.

# Oracle Java JDK 17

sudo rpm -ivh jdk-17_linux-x64_bin.rpm

# Oracle Java JDK 11

sudo rpm -ivh jdk-11.0.13_linux-x64_bin.rpm

# Oracle Java JDK 8

sudo rpm -ivh jdk-8u311-linux-x64.rpm

By default, Java JDK is put in in /usr/java/ listing. To set up Oracle JDK to a customized listing, use rpm -ivh –prefix=// rpmfile command.

Set Default Java Version

Use the choices command to set the default java edition.

sudo choices --config java

Select Java:

If your machine has a couple of Java variations, the above command will listing all Java variations like beneath.

There are 3 techniques which give 'java'.

  Selection    Command
-----------------------------------------------
 + 1           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc35.x86_64/bin/java)
   2           java-latest-openjdk.x86_64 (/usr/lib/jvm/java-17-openjdk-17.0.1.0.12-2.rolling.fc35.x86_64/bin/java)
*  3           /usr/java/jdk-17.0.1/bin/java

Enter to stay the present variety[+], or sort variety quantity: 3

Enter the quantity beneath the variety column to set the default Java edition.

Here, I selected 3 for Oracle Java 17.

Verify Java Version

Check the java edition the usage of the next command.

java -version

Output:

java edition "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (construct 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (construct 17.0.1+12-LTS-39, blended mode, sharing)

The output might range relying upon the package deal and the edition you selected to be the default Java edition.

Setup Environmental Variables

Java programs incessantly require JAVA atmosphere variables to be set within the machine. To set JAVA variables on the machine stage, create a document within the /and so on/profile.d listing.

vi /and so on/profile.d/java.sh

Then, upload the desired variables.

To set the surroundings variables for a specific person, position the beneath variables within the .bash_profile document in the house listing.

export PATH=$PATH:/usr/java/jdk-17.0.1/bin/
export JAVA_HOME=/usr/java/jdk-17.0.1/

Finally, load the environments into the present consultation.

supply /and so on/profile.d/java.sh

Conclusion

That’s All. I am hoping this put up helped you put in Java JDK/JRE 17/11/8 on Fedora 35.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More