Replacing Oracle Java with AdoptOpenJDK
Overview
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.
Steps:
- Login with Administrator permissions to the FAM server on which Elasticsearch is installed.
- If you are unsure where Elasticsearch is installed –
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
- Stop the Elasticsearch service
Open services.msc
Navigate File Access Manager Elasticsearch 5.1.1
Click Stop
- Uninstall Java 8
Open Windows “Programs and Features” (Control Panel\Programs\Programs and Features)
Select Java 8
Right click > Uninstall
- Download AdoptOpenJDK
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
- Unzip the content to some folder (i.e “C:\Program Files\AdoptOpenJDK”)
- Set your JAVA_HOME variable
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
- State new registry keys
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"
- Run the new file - this will import the registry keys.
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
- Start the Elasticsearch service and verify there are no error in the Dashboard / Activity Forensics
Troubleshooting:
Elasticsearch service is not starting:
- Navigate to the Elasticsearch Log files (generally: C:\Program Files\SailPoint\Logs\elasticsearch)
- Open elasticsearch-service-x64.{date}
- If you see: [error] [ 8620] Failed creating java
- In the Windows search, type regedit, click enter – this should open your Registry Editor
- Navigate to HKEY_LOCAL_MACHINE > Software > JavaSoft > Java Runtime Environment
- Ensure you see CurrentVersion
- If not, go ahead and manually add it
- Right-click on Java Runtime Environment > New > String Value
- Name = CurrentVersion, Data = 1.8
- Navigate to HKEY_LOCAL_MACHINE > Software > JavaSoft > Java Runtime Environment > 1.8
- Ensure you see two values JavaHome and RuntimeLib
- If you do not see them, go ahead and manually add them
- Right-click on the 1.8 folder > New > String Value
- Name = JavaHome, Data = UNZIP_LOCATION
- Name = RuntimeLib, Data = jmv.dll location (ie: C:\Program Files\AdoptOpenJDK\OpenJDK8U-jre_x64_windows_openj9_8u292b10_openj9-0.26.0\jdk8u292-b10-jre\bin\server\jvm.dll)
- Retry starting the service
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Content to Moderator
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
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Content to Moderator
How to migrate TLS Setup for IQService, leveraging CACERTS or Custom Certs