For Windows 7, I\'ve installed JDK in both 32 and 64 bit versions. The versions are 8, update 20 for all four installations. http://www.oracle.com/technetwork/java/javase/d
You can set the system-wide environment variables by clicking Start, pointing to 'Computer', right-clicking and selecting properties. Next, click 'Advanced System Settings', hitting the 'Advanced' tab and selecting the 'Environment Variables' button. This brings up a window where you can set your JAVA_HOM
E variable. You can do this either for the current user (top box) or system-wide.
After doing this, open a new cmd window (Start menu, type 'cmd
' and hit enter) and verify JAVA_HOME
is set like in the question above.
I was facing similar issue where Java home is already set but still it was throwing error. Open elasticsearch-plugin.bat file and change "IF DEFINED JAVA_HOME" to "IF DEFINED %JAVA_HOME%" , if you have java home already set.
Thanks
Can you verify JAVA_HOME
is set to C:\Progra~1\Java\jdk1.8.0_20
,
C:\>echo %JAVA_HOME%
Also, verify java
command is available,
java -version
Reference
Check if JAVA_HOME is present in environment using batch script
If JAVA_HOME
is not set, please follow the steps provided here - How to Set Java Home in windows
Summary ,
Enter the variable value as the installation path for the JDK.
(eg. C:\Progra~1\Java\jdk1.8.0_20
).
I get this error because I was using Powershell
and it wasn't seeing environment variable
. (I don't know way)
Then I used CMD
and it ran successfully.