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

**URL:** <https://discuss.elastic.co/t/logstash-plugin-bat-fails-to-find-bundled-java-in-7-16-1/295358>\
**Category:** Logstash\
**Created:** [January 25, 2022, 2:26pm UTC](https://discuss.elastic.co/t/logstash-plugin-bat-fails-to-find-bundled-java-in-7-16-1/295358 "2022-01-25T14:26:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevedearl](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@stevedearl](https://discuss.elastic.co/u/stevedearl)\
**Post date:** [January 25, 2022, 2:26pm UTC](https://discuss.elastic.co/t/logstash-plugin-bat-fails-to-find-bundled-java-in-7-16-1/295358/1 "2022-01-25T14:26:56Z")

</div>

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:

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

```

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:

```auto
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.
Usage:
    bin/logstash [OPTIONS]

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:

```auto
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.
logstash-codec-avro

```

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?

TIA,  
Steve

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [January 25, 2022, 5:16pm UTC](https://discuss.elastic.co/t/logstash-plugin-bat-fails-to-find-bundled-java-in-7-16-1/295358/2 "2022-01-25T17:16:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stevedearl](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@stevedearl](https://discuss.elastic.co/u/stevedearl)\
**Post date:** [January 26, 2022, 9:07am UTC](https://discuss.elastic.co/t/logstash-plugin-bat-fails-to-find-bundled-java-in-7-16-1/295358/3 "2022-01-26T09:07:49Z")

</div>

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.

Steve

---

<div class="post-metadata">

**Author:** ![stevedearl](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@stevedearl](https://discuss.elastic.co/u/stevedearl)\
**Post date:** [January 26, 2022, 9:54am UTC](https://discuss.elastic.co/t/logstash-plugin-bat-fails-to-find-bundled-java-in-7-16-1/295358/4 "2022-01-26T09:54:07Z")

</div>

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.

Steve

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 23, 2022, 9:54am UTC](https://discuss.elastic.co/t/logstash-plugin-bat-fails-to-find-bundled-java-in-7-16-1/295358/5 "2022-02-23T09:54:25Z")

</div>

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