I downloaded Logstash-1.5.0 on Windows 8.1 and tried to run it in the command prompt.
First I checked the java version.
Then changed the directory to logstash-1.5.0/bin
then entered the command logstash -e 'input { stdin { } } output { elasticsearch { host => localhost } stdout { } }'
it gave the following error:
Cannot locate java installation, specified by JAVA_HOME
The Logstash folder is on C: and the version of Java is 1.7.0_25. I've set the JAVA_HOME environmental variables to the jdk
/bin directory, but still it doesn't work.
I'm new to Logstash. Can somebody tell me in detail why this happens and help me fix it?
Set the JAVA_HOME
and PATH
environmental variables like this:
JAVA_HOME = C:\Program Files\Java\jdk1.7.0_25
PATH = C:\Program Files\Java\jdk1.7.0_25\bin
On Windows when you change environment over the system settings, you have to close and reopen the command shell, before the changes take effect.
Step by step:
JAVA_HOME
variable to your path and hit OK.JAVA_HOME
is set.If your JAVA_HOME
is now correctly set, logstash should work.
In my case the problem was that I set the JAVA_HOME
variable with a space in the end:
"set JAVA_HOME=c:\Programs\Java "
instead of
"set JAVA_HOME=c:\Programs\Java"
And logstash couldn't figure that out :) Removing the space fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With