Install JAVA

Linux Open SUSE Leap 15.2

Run the following commands to install JAVA openjdk 15

zypper up
zypper ar http://download.opensuse.org/repositories/Java:/Factory/openSUSE_Leap_15.2/ java
zypper mr -p 70 java
zypper refresh
zypper in java-15-openjdk
java --version

If a JAVA version is already installed on your system before the installation of openjdk 15, use alternatives command to change the java version used by your system.

alternatives --config java # In case of upgrade: Switches the links to point to the new version
# logout and login again to have the environment variables defined.

Linux CentOS/RedHat

Use the existing package installer (apt or yum for example) to install latest GA version of JAVA OpenJDK (currently 15)

Example on CentOS:

yum install java-latest-openjdk-headless.x86_64 # Installs the latest OpenJDK binaries
alternatives --config java # In case of upgrade: Switches the links to point to the new version
java -version # Check you run the latest version

Or download the Linux/x64 archive from https://jdk.java.net/ and decompress it in your usual Java install path and update /usr/bin/java link

Refer to the online documentation specific to your Linux distribution

Generic

You can download the archive from https://jdk.java.net/ and use alternatives to setup the configuration

Example:

wget https://download.java.net/java/GA/jdk22.0.1/c7ec1332f7bb44aeba2eb341ae18aca4/8/GPL/openjdk-22.0.1_linux-x64_bin.tar.gz
tar zxvf openjdk-22.0.1_linux-x64_bin.tar.gz
mv jdk-22.0.1 /usr/lib/jvm
alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-22.0.1/bin/java 99
alternatives --config java
>> Choose the one you installed