Logstash-plugin.bat fails to find bundled Java in 7.16.1

Hi All,

I upgraded to 7.16.1 a little while back and noticed today that when I try to list the installed plugins I get the following error:

C:\APPS\ELASTIC\logstash-7.16.1\bin>logstash-plugin.bat list
"Using bundled JDK: ."
No `java.exe' executable found on PATH.

I haven't made any changes to logstash-plugin.bat or any of the other batch files that come with Logstash.

Running Logstash itself works fine, and appears to be finding the bundled JDK with no issues:

C:\APPS\ELASTIC\logstash-7.16.1\bin>logstash.bat --help
"Using bundled JDK: ."
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
    bin/logstash [OPTIONS]

    -n, --node.name NAME          Specify the name of this logstash instance, if no value is given
                                  it will default to the current hostname.

Has anyone else encountered this? Is it a known bug?

The only workaround I've got at this point is to set JAVA_HOME explicitly before running logstash.plugin.bat. That works but of course now I'm getting a warning that JAVA_HOME is deprecated, and I've had to remember to set this environment variable:

C:\APPS\ELASTIC\logstash-7.16.1\bin>logstash-plugin.bat list
Using JAVA_HOME defined java: C:\APPS\ELASTIC\logstash-7.16.1\jdk
WARNING: Using JAVA_HOME while Logstash distribution comes with a bundled JDK.
DEPRECATION: The use of JAVA_HOME is now deprecated and will be removed starting from 8.0. Please configure LS_JAVA_HOME instead.

My understanding from the documentation was that Logstash should now default to using its bundled JDK unless set otherwise.
Is the issue here that this doesn't work when calling the Ruby PluginManager?


Both the logstash-plugin.bat and logstash.bat call "%~dp0setup.bat", and setup.bat does

  if exist "%LS_HOME%\jdk" (
    set JAVA="%LS_HOME%\jdk\bin\java.exe"
    echo "Using bundled JDK: %JAVA%."

I cannot think of any way that that could result in "Using bundled JDK: .". It is also really strange that it does not trip the if not exist %JAVA% ( condition just after that.

Thanks @Badger,

Actually this looks like something amiss on my server, rather than being a Logstash issue. I've just tried the same command on my local workstation (also currently using 7.16.1) and it works absolutely fine.

Not sure I understand what the problem is though. I've checked the environment variables on the server and there's nothing that looks out of place or that would affect this - however, the fact that if I set JAVA_HOME explicitly it fixes the problem is suspicious.


OK - so my local workstation has this set in its PATH command, which if I remove I see the same error when running logstash-plugin.bat as on my server. My server does not have anything java-y in its path:

C:\Program Files (x86)\Common Files\Oracle\Java\javapath

On my workstation this points to a folder containing java.exe, javaw.exe and javaws.exe.

Not sure why any of this is needed though as I still thought that Logstash would use its internal/bundled Java.


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.