Elasticsearch: "The system cannot find the path specified." when running bat file.

Created on 21 Sep 2012  路  15Comments  路  Source: elastic/elasticsearch

Windows 7
I also set %JAVA_HOME% to C:\Java\bin to avoid Program Files (Space) issue.

Most helpful comment

so basically, the JAVA_HOME should point to the parent directory of the bin. In the examples above, it should point to:

"C:\Program Files\Java\jdk1.7.0"
or
"C:\Program Files\Java\jre7"

If you look at the elasticsearch.bat file. You can insert an echo just before the line where the program is executed and echo the whole line (it might show you where things go wrong):

echo "%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% %* -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.ElasticSearch"

after executing it, make sure that the paths (as they're echoed) indeed exist. More specifically, that one of the following exists:

"C:\ProgramFiles\Java\jdk1.7.0\bin\java.exe"
or
"C:\ProgramFiles\Java\jre7\bin\java.exe"

All 15 comments

Hi,

%JAVA_HOME% should probably point to "C:\Java" in your case.

Cheers,
Uri

Thank you uboness for your suggestion. Still no joy.

My current config has:

C:\Program Files\Java\jdk1.7.0
and
C:\Program Files\Java\jre7

I tried the following:

set JAVA_HOME=C:\jre7\bin
set JAVA_HOME=C:\jre7

set JAVA_HOME=C:/jre7/bin
set JAVA_HOME=C:/jre7

set JAVA_HOME=/jre7/bin
set JAVA_HOME=/jre7

I also have a jdk1.7.0 directory but I am assuming elastic looks for runtime?

I am anxious to fire up elastic!! :)

so basically, the JAVA_HOME should point to the parent directory of the bin. In the examples above, it should point to:

"C:\Program Files\Java\jdk1.7.0"
or
"C:\Program Files\Java\jre7"

If you look at the elasticsearch.bat file. You can insert an echo just before the line where the program is executed and echo the whole line (it might show you where things go wrong):

echo "%JAVA_HOME%\bin\java" %JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% %* -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.ElasticSearch"

after executing it, make sure that the paths (as they're echoed) indeed exist. More specifically, that one of the following exists:

"C:\ProgramFiles\Java\jdk1.7.0\bin\java.exe"
or
"C:\ProgramFiles\Java\jre7\bin\java.exe"

Working!!! Thank you for stating the obvious. :)

Thanks too, :)

Thanks a ton.

If you got your elastic root folder prefixed with '!' you'll get same error.
E:!elasticsearch-1.4.4\elasticsearch-1.4.4\bin <--- wont work

thanks a bunch!

Awesome!

Still getting "System cannot find specified path" error in windows 10 even after doing above stuff..
JAVA_HOME = C:\Program Files (x86)\Java\jre1.8.0_77

Thanks this helped !!

thanks !!!

Thanks!!

Still having the error on Windows 10.

JAVA_HOME is also there,
echo %JAVA_HOME% = C:\Program Files\Java\jdk1.8.0_144

Also I have set path variable for logstash LS_HOME

image

Was this page helpful?
0 / 5 - 0 ratings