Skip to main content
Logo

Configure JAVA_HOME environment variable

Java is a platform which lets you develop and deploy Java applications on desktops and servers. The Contensis search uses Elasticsearch which requires Java to run.

If you have installed Java Runtime Environment or Java SE Development Kit but haven't set the JAVA_HOME environment variable, the following error will appear:

Error installing Contensis Search: unable to retrieve install folder for Java - please ensure that the JAVA_HOME environment variable is set correctly. Instructions can be found at https://zenhub.zengenti.com/configure-java-home

This is easily rectified. First find your Java install directory. These are the standard locations (nb. this may have been changed as it is an option when installing Java):

  • JRE - C:\Program Files\Java\jre8
  • JDK - C:\Program Files\Java\jdk1.8.0_131

When setting the JAVA_HOME environment variable it is recommended that you use shortened paths if the path contains spaces. Therefore your paths would be:

  • JRE - C:\Progra~1\Java\jre8
  • JDK - C:\Progra~1\Java\jdk1.8.0_131

Make a note of your shortened installation path as this is required in the next step.

Use the Windows GUI to add the environment variable

  1. Open the Start menu and search for environment variables. Click Edit the system environment variables.The System Properties screen will open.
  2. Press Environment Variables.
  3. Under System Variables, click New… New System Variable modal will appear.
  4. Enter the variable name as JAVA_HOME.
  5. Enter the variable value as the installation path you identified earlier.
  6. Click OK.
  7. Click Apply Changes.

Use the Command Prompt to add the environment variable

  1. Open a command prompt.
  2. Run the following command, making sure you use the correct Java install path identified earlier.

    setx -m JAVA_HOME "C:\Progra~1\Java\jre1.8.0_131"

  3. Restart Windows in order for the setting to be applied.

You can now restart the installation of Contensis and the search should install correctly.