Installing Java as a pre-requisite

Java 17 or later is a pre-requisite for scripting the automation for Keycloak Benchmark. It needs to be installed before the installation can begin.

Installing Java

There are quite a few variants of Java which you can download for free and install it. This guide focuses on the OpenJDK java installation on Linux.

You can find detailed steps to install Java based on your operating system in the installation docs.

Assuming you have installed the OpenJDK on Linux in /usr/lib/jvm, create a JAVA_HOME variable pointing to the directory of the specific JDK version you wanted to use with the provisioning automation. If you do not set up this environment variable, the installation will try to find a JDK on the path.

export JAVA_HOME=/usr/lib/jvm/java-17-openjdk...

Verifying the installation of Java

The command to verify if JAVA_HOME is set properly:

echo $JAVA_HOME

Should print an output like:

/usr/lib/jvm/java-17-openjdk-17.0.7.0.7-5.fc38.x86_64/

The command to verify if Java is installed properly on your host:

$JAVA_HOME/bin/java --version

Should print an output like:

openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.7.0.7-4.fc38) (build 17.0.7+7, mixed mode, sharing)