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
1. Get AdoptOpenJDK
If you installed YAMBAS by following the guide YAMBAS Installation before, you already have a working AdoptOpenJDK on your system. So, if you want to use this AdoptOpenJDK you can continue with step 2 which helps you to link the AdoptOpenJDK to your PATH variable.
# 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)
# 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)
2. Add Java to your PATH
The ApiOmat microservices use java to actually run healthy. For that you need to link the executable to your PATH variable:
# 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 immediately be available as command. Try it out:
java -version
# 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 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