In this article we will show you how to install different Java versions (1.8, 16, 17, …) on your virtual server quickly and easily.

Datei:Java-Logo.svg
Java Logo

We provide a script that installs different open source Java versions on your server. You just need to log in as root on the server and start running the automatic installation.

In this article we will show you how to install different Java versions (1.8, 16, 17, …) on your virtual server quickly and easily.

We provide a script that installs different open source Java versions on your server. You just need to log in as root on the server and start running the automatic installation.

We install different versions for you in the /usr/lib folder.

Supported versions

We install different versions for you in the /usr/lib folder.

Supported versions

Currently the following versions are supported:

jdk-13.0.1_linux-x64 -> java version "13.0.1" 2019-10-15
-> /usr/lib/jdk-13.0.1/bin/java
jre-8u241-linux-x64 -> java version "1.8.0_241"
-> /usr/lib/jre1.8.0_241/bin/java
openjdk-16.0.1_linux-x64 -> openjdk version "16.0.1" 2021-04-20
-> /usr/lib/jdk-16.0.1/bin/java
openjdk-17.0.1_linux-x64 -> openjdk version "17.0.1" 2021-10-19
-> /usr/lib/jdk-17.0.1/bin/java

Installation

To install these versions on your server, please run the following command:

bash <(wget -qO - https://pph.sh/docs/java.sh)

Alternatively, you can use the app installer to install Java.

Cloud Manager: Install Java packages

Change default version

To set the default version (java in the console), run the following command after installation:

select-default-java

Here you select which version to use as the default Java. We create a link from /bin/java to the selected version.

View available versions

To view all versions installed by the script, run the following command after running the Java installer:

show-java-versions
Example of installation