# Error caused by check of JAVA\_TOOL\_OPTIONS when running Logstash on Windows

**URL:** <https://discuss.elastic.co/t/error-caused-by-check-of-java-tool-options-when-running-logstash-on-windows/234729>\
**Category:** Logstash\
**Created:** [May 28, 2020, 11:18am UTC](https://discuss.elastic.co/t/error-caused-by-check-of-java-tool-options-when-running-logstash-on-windows/234729 "2020-05-28T11:18:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulr3](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@paulr3](https://discuss.elastic.co/u/paulr3)\
**Post date:** [May 28, 2020, 11:18am UTC](https://discuss.elastic.co/t/error-caused-by-check-of-java-tool-options-when-running-logstash-on-windows/234729/1 "2020-05-28T11:18:39Z")

</div>

Hi,

I've encountered an issue when I try to run the Windows version of Logstash. When I run logstash.bat I receive the following error message:

"Microsystems was unexpected at this time"

The issue appears to be in setup.bat. Here it uses the following code to check the value of the JAVA\_TOOL\_OPTIONS environment variable:

`if not %JAVA_TOOL_OPTIONS% == "" (`

On my machine the value of JAVA\_TOOL\_OPTIONS is:

`-Djava.vendor="Sun Microsystems Inc"`

The check seems to fail due to the presence of double-quotes in the value.

I've noticed that the Elasticsearch elasticsearch-env.bat script also performs a check of JAVA\_TOOL\_OPTIONS but that doesn't fail. This appears to be because it uses a different way of checking the value, namely:

`if defined JAVA_TOOL_OPTIONS (`

It may be possible to use this way of checking JAVA\_TOOL\_OPTIONS in Logstash setup.bat.

The same section of code in Logstash setup.bat also appears to use the wrong syntax to reference the value of the JAVA\_TOOL\_OPTIONS variable. In the line where it displays the warning message about ignoring the value of JAVA\_TOOL\_OPTIONS it uses $JAVA\_TOOL\_OPTIONS - this should be %JAVA\_TOOL\_OPTIONS%.

I've encountered this on version 7.6.2 of Logstash.

Thanks,

-Paul

---

<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:** [June 25, 2020, 11:18am UTC](https://discuss.elastic.co/t/error-caused-by-check-of-java-tool-options-when-running-logstash-on-windows/234729/2 "2020-06-25T11:18:43Z")

</div>

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