×


Install Java on openSUSE Leap 15.3 - Step by step guide ?

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.

Here at Ibmi Media, we shall look into how to install Java SE (Standard Edition) on the openSUSE Leap 15.3 system.

If you need to install Java on other Linux distributions, visit how to install Java on Ubuntu and Debian.


Different ways of installing Java SE (Standard Edition) on the openSUSE:

  • Java installation via Google Chrome Repository.
  • Java installation via RPM Package.


a. Java installation via Google Chrome Repository

To install Java via this method, follow the below steps:

1. Go to  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.

Alternatively, 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 below command:

$ 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.


b. Java installation via RPM Package

To install java via this method, simply follow the below steps:

1. Go to 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.

Alternatively, 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 below commands:

$ 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 below command:

$ java --version

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


[Need help in fixing Java packages issues on your Linux system ? We can help you. ]


Conclusion

This article covers how to install Java on openSUSE via different methods. In fact, Java is a general-purpose, class-based, object-oriented multipurpose programming language that is popular due to the design of having lesser implementation dependencies, meaning that the compiled Java code can be run on all platforms that support Java without the need for recompilation.