ElasticSearch and Java environment variable ElasticSearch and Java environment variable elasticsearch elasticsearch

ElasticSearch and Java environment variable


STEP 1

Can you verify JAVA_HOME is set to C:\Progra~1\Java\jdk1.8.0_20,

C:\>echo %JAVA_HOME%

Also, verify java command is available,

 java -version

Reference

Check if JAVA_HOME is present in environment using batch script

STEP 2

If JAVA_HOME is not set, please follow the steps provided here - How to Set Java Home in windows

Summary ,

  • Right-click the My Computer icon on your desktop and select Properties.
  • Click the Advanced tab. Click the Environment Variables button. Under System Variables, click New.
  • Enter the variable name as JAVA_HOME.
  • Enter the variable value as the installation path for the JDK.

    (eg. C:\Progra~1\Java\jdk1.8.0_20).

  • Click OK.
  • Click Apply Changes.


A workaround if you do not have privileges to set up the environmental variables:

open the elasticsearch.bat file,

a) Remove the line:

if NOT DEFINED JAVA_HOME goto err

b) Replace %JAVA_HOME% with your java jdk path, something like: C:\Program Files\Java\jdk1.7.0_51

And for your terminal getting started and you not being able to type anything, it isthe elasticsearch server, you need to connect to it using a client like cygwin.

https://cygwin.com/install.html

For connecting to the server refer the elasticsearch documentation.

http://www.elasticsearch.org/guide/

A similar question has already been answered:

"JAVA_HOME points to an invalid Java installation issue" with service install command in elastic search


run the below command:

set JAVA_HOME=C:\Program Files\Java\jre8