Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want to use elastic search with my PHP application.

after running service install command , I am getting fallowing error.

C:\elasticsearch-0.90.10\bin>service install
JAVA_HOME points to an invalid Java installation (no java.exe found in "C:\Progr
am Files (x86)\Java\jdk1.7.0_25\bin"). Existing...
like image 615
Urdesh Kumar Avatar asked Jan 29 '14 10:01

Urdesh Kumar


3 Answers

Open up and Look into the service.bat file:

It searches for:

%JAVA_HOME%\bin\java.exe

hence your %JAVA_HOME% should not include bin in it.

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

open the service.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

Note: This is just a workaround which works all the time.

like image 168
BatScream Avatar answered Oct 31 '22 15:10

BatScream


from your error message we can see your JAVA_HOME points to

C:\Program Files (x86)\Java\jdk1.7.0_25\bin

while it should point to

C:\Program Files (x86)\Java\jdk1.7.0_25
like image 45
FrederikT Avatar answered Oct 31 '22 14:10

FrederikT


I think the error message is fairly descriptive , you should look in this folder is java.exe there ? If not then your JAVA_HOME environment variable to point to the correct installation

heres a page showing how to do that https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows

1st hit on google.

like image 29
Shaun Hare Avatar answered Oct 31 '22 15:10

Shaun Hare