I was trying to setup a keystore and when running .\logstash-keystore.bat I get a message saying "Using bundled JDK: "" then it says, No 'java.exe' executable found on PATH. I'm running version 7.15.1. The crazy thing is when I try to manual execute logstash, it finds the bundled java path and tries to start....obviously it does not start because my keystore is not set up.
Here is what the logstash-keystore.bat file looks like.
@echo off
setlocal enabledelayedexpansion
call "%~dp0setup.bat" || exit /b 1
if errorlevel 1 (
if not defined nopauseonerror (
pause
)
exit /B %ERRORLEVEL%
)
%JRUBY_BIN% "%LS_HOME%\lib\secretstore\cli.rb" %*
if errorlevel 1 (
exit /B 1
)
endlocal
That feels a lot like a bug to me. bin/setup.bat sets the JAVA environment variable, which is what the other elastic .bat scripts use to find java. However, the jruby process launcher looks at -Xjdkhome, JAVA_HOME, and PATH, so it is unaffected by this.
Yeah, I thought about that but Elasticsearch is on the same node so I was worried Elasticsearch would try to use that path over its own bundled JDK. I'll give it a shot and see what happens.
OK, so I was hesitant to set a system wide JAVA_HOME env variable so I found a way to ephemerally set it in PowerShell: $env:JAVA_HOME = "C:\Path\To\logstash-7.x.x\jdk"
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.