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
- Open the Start menu and search for environment variables. Click Edit the system environment variables.The System Properties screen will open.
- Press Environment Variables.
- Under System Variables, click New… A New System Variable modal will appear.
- Enter the variable name as JAVA_HOME.
- Enter the variable value as the installation path you identified earlier.
- Click OK.
- Click Apply Changes.
Use the Command Prompt to add the environment variable
- Open a command prompt.
- 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"
- Restart Windows in order for the setting to be applied.
You can now restart the installation of Contensis and the search should install correctly.
Was this article helpful?