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...
Open up and Look into the
service.bat
file:It searches for:
hence your
%JAVA_HOME%
should not includebin
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:
b) Replace
%JAVA_HOME%
with your javajdk
path, something like:C:\Program Files\Java\jdk1.7.0_51
Note: This is just a workaround which works all the time.
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.
Either JAVA_HOME points to the wrong location or you don't have Java installed. Check and see if there's an install of Java in the location specified.
Also note that the JAVA_HOME variable should point to the root of the Java install not the /bin folder. This is being added by the program you're executing.
To change the JAVA_HOME variable to test further use the following in the command prompt:
Once you've established the correct value to use this can be permanently changed in Control Panel>>System>>Advanced System Settings>>Advanced>>Environment Variables
set JAVA_HOME=C:\Program Files (x86)\Java
Above must fix the issue, I came across the same issue while installing the elastic search. i gave a try by giving "bin" part of path but it did not work, so i just give the top folder "java" in path, it worked.
from your error message we can see your JAVA_HOME points to
while it should point to
Just to add my own experience. i was setting JAVA_HOME using tab autocompletion. It ends up something like "C:\Program files...:" and it didn't work saying that it cannot find the java program. I solved typing the JAVA_HOME path in the set command without using tab completion. The problem was probably related to the " in the env variable