Skip to main content

Commerce

Optimizely Commerce Elastic Search – Replacing Oracle JDK to Open JDK

Laptop Computer Works

Introduction- 

The Optimizely framework utilizes Elasticsearch for indexing product, category, and content data, enhancing site search speed. Elasticsearch, functioning as a local search engine, indexes the data into ‘Apache Lucene’ files and retrieves search results based on indexed data, significantly speeding up search operations compared to database queries. As a standalone Windows service built using Java, Elasticsearch requires Java runtime, typically fulfilled by Oracle JDK. However, since Oracle JDK is a paid installer, transitioning to the freely available OpenJDK is necessary. I’ll outline the steps to replace Oracle JDK with OpenJDK to support running the Elasticsearch service.

 

How to install Open JDK?

  1. Open “Control Panel\Programs\Programs and Features” and uninstall Oracle JDK.
  2. The user can download and install the Open JDK installer from the internet.
  3. “JDK (AdoptOpenJDK) x64 8”, “Java (AdoptOpenJDK) x64 21”, and “JDK (AdoptOpenJDK) x64 17” are the recommended Open JDK versions. Verify the installed application from “Control Panel\Programs\Programs and Features”.
  4. Check the installed version of OpenJDK by going to “Control Panel\Programs\Programs and Features”. Openjdkaddremove
  5. In the “Eclipse Adoptium” or “Eclipse Foundation” folder, look through “C:\Program Files” and make sure the “jdk-8.0.302.8-hotspot” folder is present.Openjdkcpath
  6. Verify whether the Program Files/Open JDK path has the “jre” folder created or not. If it isn’t created, try a different Open JDK version.Openjdkc Jre Path

 

How to use Open JDK to run ElasticSearch service?

  1. Open the JDK JRE path and copy it. such as “C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\jre”.
  2. Use Windows search to find “edit the system environment variables” and click on it.
  3. Press the “Environment Variables” button.
  4. Paste the copied path into the “JAVA_HOME” system variable and save the changes.Java Home
  5. Start the ElasticSearch service.

 

Troubleshooting

  1. Elastic service doesn’t start after setting up JAVA_HOME and installing Open JDK.
    • Uninstall the “ElasticSearch” service and verify by going to C:\Program Files.
    • Start the PowerShell application in Windows.
    • Choose the “install.ps1” path from the path where the elastic search installer is located (use any local Optimizely website’s elastic path).Elasticsearchinstaller File
    • Make sure the Elasticsearch service is up and running after receiving the successful “Elasticsearch Service Endpoint: http://localhost:9201” message.
  2. The user should install “JDK (AdoptOpenJDK) x64 17” if they are using “Elasticsearch version 7.”

 

Conclusion

In this article, we’ve explored utilizing OpenJDK to operate the Elasticsearch service, aiming to lower licensing expenses by substituting Oracle JDK.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pankaj Rahangdale

Pankaj Rahangdale is a Lead Technical Consultant specializing in .NET and Optimizely Commerce. With a wealth of knowledge and a professional background spanning over ten years, he has honed his expertise in Optimizely Configured (Insite) Commerce, inRiver PIM, Sitecore, and .Net-based applications.

More from this Author

Categories
Follow Us