Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while installing Elasticsearch on Windows

I have setup the Java path and I tried to run ElasticSearch on Windows 7. But I'm getting this error:

"no java.exe found on C:\Program Files\Java\jdk1.7.0_17\bin\".

I can run java & javac, they work fine.

How do I solve this issue?

like image 784
Suresh Avatar asked Nov 17 '13 15:11

Suresh


People also ask

How do I install Elasticsearch as a Windows service?

Install and run Elasticsearch as a service on WindowseditC:\elasticsearch-8.4. 3\bin>elasticsearch-service. bat install Installing service : "elasticsearch-service-x64" Using ES_JAVA_HOME (64-bit): "C:\jvm\jdk1. 8" The service 'elasticsearch-service-x64' has been installed.

How do I install Elasticsearch on Windows 11?

Prerequisites of installing Elasticsearch Before installing Elasticsearch, Java must be installed on your system on which you are going to use Elasticsearch. 2. If Java is already installed, check the version of Java by running java -version command on command prompt (CMD). Remember, its version must be 11 or higher.


2 Answers

So, I've kept hitting this problem and the solution is twofold. Like Udit said your Java_Home path should not include the bin folder (the reason being that the elastic search bat file seems to add on the bin folder manually, so if you add it the path would be bin\bin)

The second thing to check for is spaces in your path. If Java is installed to C:\Program Files then use C:\Progra~1 and if it's in C:\Program Files (x86) then use C:\Progra~2.

This should mean your Java_Home is set to something like C:\Progra~1\Java\jre7

To Verify this works open a command prompt and type %Java_Home%\bin\java and press return, you should then see all the command line parameters for Java listed. If you get this far you should be able to just run elasticsearch.bat

like image 161
Andy Davies Avatar answered Sep 21 '22 13:09

Andy Davies


JAVA_HOME is the environment variable that points to Java installation directory. Example: If u have installed Java in 32 bit windows 7 operating system, it would have installed in

C:/Program Files/Java/jdkx.x.x

This path should be put as JAVA_HOME. Probably you have set the path till bin directory i.e. C:/Program Files/Java/jdkx.x.x/bin

that is why it cannot find the java.exe.

like image 26
Udit Narayan Avatar answered Sep 19 '22 13:09

Udit Narayan