Elastic Search Error – JAVA_HOME environment variable must be set!

Published on February 25, 2016 by abundantcode

Filed under Elastic Search

Last modified February 25, 2016

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 3 (1 votes)

This article have been viewed 2214 times

When trying to get the Elastic Search running on a Windows 10 machine , there are times when you would hit with the below problem which is related to Java.

JAVA_HOME environment variable must be set!

If there are any java developers out there , then it would be easier for them to identify this issue. For all those who are new to Java , here’s the step to get it resolved.

How to Set Java_Home Environment on Windows 10 PC ?

1. Download and install the latest version of Java and JDK.

2. Navigate to the folder where the Java JDK is installed. This is generally in the path C:\Program Files\Java\ if the machine is a 64 bit machine . Incase of 32-bit machine , this will be C:\Program Files(x86)\Java\

Under this folder , identify the Java JDK installation and use that as the path (copy it) . In my case , the path is C:\Program Files\Java\jdk1.8.0_73

3. Navigate to the desktop , right click on "My PC" and select "Properties".


4. Click "Advanced System Settings" in the left sidebar of the screen and select "Environment Variables.

5. In the Environment Variables Dialog , click "new" button in the System Variables.


6. In the Dialog , enter "JAVA_HOME" in the Variable Name and put the path of the JDK installation in the Variable Value and click OK.

7. Now , start the Elastic Search batch file . You should see the Elastic Search starting successfully now.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


You might be Interested in these Posts

How to hide virtual keyboard in android using Java?

There are times when you want to hide the virtual keyboard in android. You can easily do that using ...

Java - How to use Packages to organize code ?

Problem Statement You need to use packages in java to organize your code. Solution Your Java prog...

Java - How to accept input from Keyboard ?

Problem Statement You need to accpet user input from the keyboard from your java program and displa...