Installing Solr for Sitecore with OpenJDK

I’m going to go into a post about installing Sitecore for local development in a later post (because it seems to be a good warmup post to get into Sitecore blogging!) but I thought I’d start with something that’s been covered, installing Solr, with a topic that’s not as discussed, using OpenJDK.

OpenJDK is, as the name states, an open source version of the Java development kit. Because Oracle has started charging for using Java in its later versions, we can use OpenJDK in its place to accomplish our Solr installation. Here are the steps I used to do the install.

  1. Install Chocolatey, a package manager for Windows, which we’ll use to install OpenJDK. Launch a PowerShell window as an administrator and execute this command:
    Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString(''))
  2. Install Adobe PDF iFilter 9 to index the content of media files. Only version 9 is supported. Install the appropriate version for your operating system; I always use a virtual machine with Windows Server 2016 64-bit, personally.
  3. Install OpenJDK using Chocolatey. Launch a PowerShell window as an administrator and execute this command:
    choco install openjdk -y
  4. OpenJDK will be installed to c:\Program Files\OpenJDK; you’ll need the version installed, which will be in a folder named jdk-x.x.x. As of this writing, the version installed by Chocolatey was 12.0.1.
  5. Download the Install-Solr.ps1 script from my GitHub repository: Save it to a local file. (EDIT 5/17/19: This file has been updated due to an error running after install.)
  6. Launch a PowerShell window as an administrator and run the Install-Solr.ps1 script. You’ll be prompted for several pieces of information:
    • Solr Version: 7.3.1
    • Solr Hostname: [your choice]
    • Solr Port: [your choice]
    • OpenJDK Version: [from step 4, above)

After these steps, you’ll have a local Solr installation, with a self-signed SSL certificate, ready to go.

One difference from the Sitecore instructions is the Solr version. Sitecore says to use 7.2.1, but we’re using 7.3.1 here. The main reason is because the Java detection scripts in the 7.2.1 install do not accurately detect the version. For example, Java 8 is listed as version 1.8, and the installer is looking for a version number in that format. That was corrected in 7.3.1.

The original version of the Solr installation script was taken from Jeremy Davis’ excellent blog post. The original information about the use of Solr 7.3.1 can be found in Kayee’s detailed blog, which goes into topics similar to this blog but with more historical context to the whys-and-wherefores. I recommend them for context and hope this blog gives you the streamlined instructions needed.

Spread the word. Share this post!

Leave a comment

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