openSUSE

How to Install Java on openSUSE

How_to_Install_Java_on_openSUSE

Java is a fast, secure and one of the most popular multi-purpose programming language and computing platform. Java has lot of advantages as compared to other programming languages, making it a good choice for almost any programming task. There are a number of applications and some websites that do not function without Java.

In this tutorial, we will show you how to install Java SE (Standard Edition) on the openSUSE system through two different methods.

  • Installation of Java through Google Chrome Repository
  • Installation of Java through RPM Package

Note: We have tested the methods described here on openSUSE Leap 15.3.

Method#1 Installing Java Using RPM

This method explains the installation of Java on openSUSE using the RPM package available at the Oracle website.

1. Visit the Oracle Downloads page and download JDK x64 Compressed Archive .rpm package. There are two Java packages: Java Development Kit (JDK) and Java Runtime Environment (JRE). The JDK includes JRE. When you will install Oracle JDK, JRE will also be installed alongside it.

On the other hand, you can use the command below to download Oracle JDK:

$ wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm

2. Now to install Java, run the command below:

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

This command will install JDK 17 on your openSUSE machine.

3. To verify the installation of JDK, run the command below:

$ java --version

The output below verifies that Java version 17 has been installed on our openSUSE machine.

Method#2 Installing Java on openSUSE Manually

This method explains the installation of Java manually on openSUSE using the tar.gz package available at the Oracle website.

1. Visit the Oracle Downloads page and download JDK x64 Compressed Archive tar.gz package. There are two Java packages: Java Development Kit (JDK) and Java Runtime Environment (JRE). The JDK includes JRE. When you will install Oracle JDK, JRE will also be installed alongside it.

On the other hand, you can use the command below to download Oracle JDK:

$ wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz

The downloaded file is the archive file in tar.gz format.

2. Extract the downloaded archive through the command below. Before extracting the archive, ensure that you are in the same directory that includes the archive file.

$ tar -xvf jdk-17_linux-x64_bin.tar.gz

3. After extracting the archive, run the command below to move it to the /opt directory:

$ sudo mv jdk-17 /opt/jdk17

4. Now set the JAVA_HOME environment variable through the commands below:

$ export JAVA_HOME=/opt/jdk17
$ export PATH=$JAVA_HOME/bin:$PATH

Now the installation of Java has been completed.

5. You can verify the installation of Java through the command below:

$ java --version

The output below verifies that Java version 17 has been installed on our openSUSE machine.

This tutorial covered the installation of Java on openSUSE through two different methods. If you need to install Java on other Linux distributions, visit how to install Java on Ubuntu and Debian.

Similar Posts