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. Java is also fast, secure, and reliable, therefore. It is widely used for developing Java applications in laptops, data centers, game consoles, scientific supercomputers, cell phones, etc.
JDK 17 (JDK 17) has brought forward new language enhancements, updates to the libraries, support for new Apple computers, removals and deprecations of legacy features, and work to ensure Java code written today will continue working without change in future JDK versions.
In the following tutorial, you will learn how to install the latest Java 17 (JDK 17) on openSUSE 15 Leap.
Prerequisites
- Recommended OS: openSUSE Leap – 15.x
- User account: A user account with sudo or root access.
Update Operating System
Update your openSUSE operating system to make sure all existing packages are up to date:
Bash/Shell
The tutorial will be using the sudo command and assuming you have sudo status.
To verify sudo status on your account:
Bash/Shell
Example output showing sudo status:
Bash/Shell
To set up an existing or new sudo account, visit our tutorial on adding a User to Sudoers on openSUSE.
To use the root account, use the following command with the root password to log in.
Advertisement
Method 1. Install JDK 17 with RPM
The first method is to download the RPM to install JDK 17. This method is quick and straightforward. However, this method doesn’t leave any room for customization for the installation, which developers often prefer.
First, visit the downloads page and download the latest RPM.
Arm 64 RPM Package:
x64 RPM Package (Most Common):
Next, once the RPM has finished downloading, execute the following command to install JDK 17.
Example output:
Confirm the installation by checking the version and build number:
Example output:
Method 1. Install JDK 17 – Manual Method
The second and most recommended option is to install Java JDK 17, the manual way that benefits users more freedom and power on what they want and where installed on their system.
Download Latest Java 17 Build
Visit the downloads page to get the latest build version link, then use the following curl command:
Once the download is complete, you need to extract the archive as follows:
Configure and Install JDK 17
Next, move the extracted archive directory into the /opt/ location:
Now you need to set the environment variables as below:
Java 17 is now installed. To confirm, use the following commands:
If installed correctly, you should see the following output:
As you can see, you can see the version is the latest Java 17 JDK build.
Advertisement
Test Java 17 LTS – Create Hello World Application
To finish off, it is always handy to test installations of these kinds to confirm everything is working correctly after being installed. The easy way is to create a small program script to test using the famous Hello World example.
First, create the Java program file as follows
Next, add the following Java code into the file:
Save the file (CTRL+O), then exit (CTRL+X).
Next, compile the code:
Finally, run the Java code with the following command:
Example output:

Congratulations, everything is working correctly.
Comments and Conclusion
In the tutorial, you have learned how to download and install the latest version of Java 17 (JDK 17). Overall, for developers to upgrade Java can be a painstaking task, but in the long term, upgrading to Java 17 will be worth the goal of being an LTS version support will be around along with improvements for quite some time.
https://www.linuxcapable.com/how-to-install-java-17-lts-jdk-17-on-opensuse-15-leap/
Post a Comment