. . .

AdoptOpenJDK Installation



Introduction

When using ApiOmat microservices such as Explorer, a Java Runtime Environment is required for executing the service at an operating system level. This page explains how to install a Java Development Kit from AdoptOpenJDK. AdoptOpenJDK provides prebuilt OpenJDK binaries and LTS support for several versions.

Installation

1. Get AdoptOpenJDK

If you have already installed YAMBAS by following the respective guide, you already have a working JDK on your system. So if you want to use that JDK, you can continue with step 2.Linux

# Download latest OpenJDK 8 release:
https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot
# (For OpenJDK 11: https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot)
 
# Go to /opt folder
cd /opt
 
# Extract the .tar.gz. You can use the following command:
tar -xf OpenJDK8U-jdk_x64_linux_hotspot_8u*.tar.gz
# (For OpenJDK 11: tar -xf OpenJDK11U-jdk_x64_linux_hotspot_11.*.tar.gz)

Windows

# Download latest OpenJDK 8 release:
https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot
# (For OpenJDK 11: https://adoptopenjdk.net/?variant=openjdk11&jvmVariant=hotspot)
 
# Go to C:\
cd /d C:\
 
# Create Java directory if it doesn't exist yet and go into it
md Java
cd Java
 
# Extract the .zip. You can use the following command (change the filename to match your downloaded version):
unzip OpenJDK8U-jdk_x64_windows_hotspot_8u202b08.zip
# (For OpenJDK 11: unzip OpenJDK11U-jdk_x64_windows_hotspot_11.0.1_13.zip)

2. Add Java to your PATH

The ApiOmat microservices are run with Java. To be able to do this, you need to add the executable to your PATH variable:Linux

# Add the downloaded version of Java to your PATH by creating a link to the Java binary in /usr/bin:
ln -s /opt/jdk8u*/bin/java /usr/bin/java
# (For OpenJDK 11: ln -s /opt/jdk-11.*/bin/java /usr/bin/java)
 
# Java should now be available as a command. Try it out:
java -version

Windows

# Add the downloaded version of Java to your PATH (change the directory according to your downloaded version):
set PATH=%cd%\Java\jdk8u202-b08\bin;%PATH%
# (For OpenJDK 11: set PATH=%cd%\Java\jdk-11.0.1+13\bin;%PATH%)
 
# Note: For the microservices to properly work with the OpenJDK even after a reboot, you need to permanently update the PATH!
# You can do this by editing the Windows Registry, either via command line (please see your operating system's documentation for this) or via Windows' GUI.
# In some cases a reboot is required for the changes to take effect.
 
# Java should now be available as a command. Try it out:
java -version

Next steps

Install microservices, e.g. Lurker.