I also tried setting up ElasticSearch on my Windows 2016 R2 data center (64-bit). Let me share some of my impressions on how to solve this problem.
Setting JAVA_HOME
Make sure you have JDK / JRE installed. You can download here .
Set the JAVA_HOME environment variable. To do this, open the Start menu and enter " path ".

Then click Environment Variables . If you do not already have the JAVA_HOME variable, click Create .

The JAVA_HOME variable should only lead to the JDK / JRE directory, not including / bin.
C:\Progra~1\Java\jdk1.8.0_112
Progra ~ 1 corresponds to Program Files . If you are using Program Files (x86) , change Progra ~ 1 to Progra ~ 2
Reboot the computer. After restarting your computer, open CMD and enter echo% JAVA_HOME% . The exit should be
C:\Progra~1\Java\jdk1.8.0_112
If you get the following result, your JAVA_HOME is configured correctly.
Running ElasticSearch
The first time I tried running ElasticSearch, I get the following output.

The odd directory that I pointed out here gave me a hint that the batch file might be reading from the wrong directory. So what I did was a bit of work with the batch file. Open elasticsearch.bat using any text editor.
Scroll all the way to the end, somewhere above the last lines you will see something similar to the following.

Delete the highlighted line, save the file and try running the batch file again using the command line.
This works in my case.

After that, open your browser and go to localhost: 9200 .

I think that it's?
Nicholas lie
source share