9

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?

2
  • is the " at the end of C:\Programe Files\Java\jdk1.7.0_17\bin\" normal ? Commented Nov 17, 2013 at 15:31
  • 1
    Yes. JAVA_HOME points to an invalid Java installation (no java.exe found in "C:\Program Files\Java\jdk1.7.0_17\bin\"). Existing... Commented Nov 17, 2013 at 16:19

2 Answers 2

9

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

Sign up to request clarification or add additional context in comments.

Comments

4

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.