This document outlines the steps to replace Oracle Java with AdoptOpenJDK. AdoptOpenJDK is an open source software which can be utilized in leu of a licensed Oracle Java platform.
Login to the Admin Client
Click Health Center from the Navigation menu
Select the Infrastructure tab
Click on File Access Manager Elasticsearch
In the details page, the Server Name will be listed
Open services.msc
Navigate File Access Manager Elasticsearch 5.1.1
Click Stop
Open Windows “Programs and Features” (Control Panel\Programs\Programs and Features)
Select Java 8
Right click > Uninstall
Go to https://adoptopenjdk.net/
Click on “Other platforms”
Choose version OpenJDK 8 (LTS)
Download the latest OpenJDK8 x64 JRE archive(*.zip) for your proper platform
Open an elevated command line and run the following command:
setx -m JAVA_HOME "[UNZIP_LOCATION]"
The output should state SUCCESS: Specified value was saved
NOTE: Make sure the [UNZIP_LOCATION] points to the location where the “bin” and “lib” folders are. For example, the [UNZIP_LOCATION] is “C:\Program Files\AdoptOpenJDK\OpenJDK8U-jre_x64_windows_openj9_8u292b10_openj9-0.26.0\jdk8u292-b10-jre”:
You can verify it was set properly by navigating to Environment Variables and validate the Value has been reset
Using Notepad, create a new text file with .reg extension and save to your desired location
Paste the following (make sure to replace UNZIP_LOCATION with the correct value)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.8"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="UNZIP_LOCATION"
Ex. "JavaHome"="C:\Program Files\AdoptOpenJDK"
"RuntimeLib"="UNZIP_LOCATION\\bin\\server\\jvm.dll"
Ex. "RuntimeLib"="C:\Program Files\AdoptOpenJDK\OpenJDK8U-jre_x64_windows_openj9_8u292b10_openj9-0.26.0\jdk8u292-b10-jre\bin\server\jvm.dll"
Double-click on the file to run
or
Open an elevated command line
Change directories to the location of the saved .reg file created in the step above
I.e. cd [location of file]
Enter the name of the saved registry file including extension and hit enter
Ie [nameoffile].reg
This should prompt a message from the Registry Editor
Click Yes
A confirmation should then appear:
Click OK
Elasticsearch service is not starting:
Hi,
Thank you for this helpful article!
I think we can also install using the OpenJDK8 x64 JRE MSI version, but we must correct the JAVA_HOME variable, removing the final "\".
For example, JAVA_HOME system variable should be:
C:\Program Files\Eclipse Adoptium\jre-8.0.332.9-hotspot
Instead of:
C:\Program Files\Eclipse Adoptium\jre-8.0.332.9-hotspot\
Thanks again.
Paulo
How to migrate TLS Setup for IQService, leveraging CACERTS or Custom Certs