. . .

AdoptOpenJDK Installation

Introduction

When using ApiOmat microservices like Lurker, a Java Runtime Environment is required when executing the service at an operating system level. This page is about how to install a Java Runtime Environment, namely the AdoptOpenJDK. AdoptOpenJDK provides prebuilt OpenJDK binaries and LTS support for several versions.

Installation

# 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)
 
# Add this 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 immediately be available as command. Try it out:
java -version
# Download latest JAVA 11 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 according to 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)
 
# Add this 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 add it to 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 command. Try it out:
java -version

Next steps

Install microservices, e.g. Lurker.