OpenJDK Install

So what I started with was to get OpenJDK installed, and then have that working with the recommend version for Sitecore 9.1: SOLR 7.2.1.

So we first need to make sure that we have the OpenJDK installed. OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java platform. As said in my previous blogpost, I’m using Chocolatey as my software automation tool.

Chocolatey is a package manager for Windows which allows you do quickly automate software installations. If you haven’t already installed it, make sure you install it here. Once installed make sure you open up a command prompt or Powershell prompt and run the following command:

choco install openjdk

This will make sure that the latest version of the OpenJDK gets installed onto your local machine. The JAVA_HOME path variable gets added with a path of: C:\Program Files\OpenJDK\jdk-11.0.2.

With that in place I thought it was basically adjusting the Jeremy Davis script from his low-effort-solr-installs blog-post, but now with changes to the OpenJDK installation path:

So instead of having $JREVersion = “1.8.0_201”, we now adjust that to $OpenJDKVersion = “11.0.2”.

And instead of having $JREPath = “C:\Program Files\Java\jre$JREVersion”, we now adjust that to $JREPath = “C:\Program Files\OpenJDK\jdk-$OpenJDKVersion”.

But apparently that was not it entirely. When I ran the adjusted script I found out that the script was failing when the automatic script wants to start the SOLR service automatically for you and fire it up. So here’s where all the troubles started and where I ran into problems. Apparently when we run: solr.cmd start, the batch file checks for a specific major JAVA version and it throws the following error and it won’t start the service.