# Logstash Error - Oracle"" was unexpected at this time

**URL:** <https://discuss.elastic.co/t/logstash-error-oracle-was-unexpected-at-this-time/361185>\
**Category:** Logstash\
**Tags:** windows\
**Created:** [June 10, 2024, 5:37pm UTC](https://discuss.elastic.co/t/logstash-error-oracle-was-unexpected-at-this-time/361185 "2024-06-10T17:37:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asandhu](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asandhu](https://discuss.elastic.co/u/asandhu)\
**Post date:** [June 10, 2024, 5:37pm UTC](https://discuss.elastic.co/t/logstash-error-oracle-was-unexpected-at-this-time/361185/1 "2024-06-10T17:37:51Z")

</div>

Hello All

I am trying to set up Logstash on my Local to connect to a hosted Elastic instance. Having followed the steps to set up Logstash - I get the following error when trying to run it.

![image](https://us1.discourse-cdn.com/elastic/original/3X/8/8/88a0a4e34a296ab0be2eff8dc40b860ac7588630.png)

I thought I had multiple versions of Java on my system which might be the cause but I have removed the new versions.

I have taken a look at this thread: [Issue on setting up Logstash](https://discuss.elastic.co/t/issue-on-setting-up-logstash/149679)

but that thread seems to have been locked without resolution.

I also tried out things like setting up the JAVA\_HOME to a java external from the Java provided by logstash but nothing seems to have worked. Also to note, even after setting the JAVA\_HOME, it seems like my logstash was still using the logstash jdk instead of the JAVA\_HOME one.

Can anyone please help?

Thanks

---

<div class="post-metadata">

**Author:** ![asandhu](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asandhu](https://discuss.elastic.co/u/asandhu)\
**Post date:** [June 10, 2024, 5:38pm UTC](https://discuss.elastic.co/t/logstash-error-oracle-was-unexpected-at-this-time/361185/2 "2024-06-10T17:38:53Z")

</div>

Note: These are my Java Details

![image](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a84a487e7571ba20a9e9d8576008b165f772f62.png)

---

<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:** [June 10, 2024, 6:37pm UTC](https://discuss.elastic.co/t/logstash-error-oracle-was-unexpected-at-this-time/361185/3 "2024-06-10T18:37:52Z")

</div>

Testing with 7.12.0 on Windows ..

```auto
C:\logstash-7.12.0>bin\logstash.bat -e "input {stdin{}} output {stdout{}}"
"Using bundled JDK: "C:\logstash-7.12.0\jdk\bin\java.exe"""
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
...

```

That works fine. Now we try

> set JAVA\_TOOL\_OPTIONS=-Djava.vendor="New Oracle"

and we get

```auto
C:\logstash-7.12.0>bin\logstash.bat -e "input {stdin{}} output {stdout{}}"
"Using bundled JDK: "C:\logstash-7.12.0\jdk\bin\java.exe"""
Oracle"" was unexpected at this time.

```

The problem is in setup.bat, where it tries to unset JAVA\_TOOL\_OPTIONS if it is set

```auto
rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
if not "%JAVA_TOOL_OPTIONS%" == "" (

```

that last line evaluates to

> if not "-Djava.vendor="New Oracle"" == "" (

which blows up with the error message that you noted. If you cannot unset JAVA\_TOOL\_OPTIONS you could try editing setup.bat to do

```
rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
if defined JAVA_TOOL_OPTIONS (
  echo "warning: ignoring JAVA_TOOL_OPTIONS=%JAVA_TOOL_OPTIONS%"
  set JAVA_TOOL_OPTIONS=
)

```

instead of

```
rem do not let JAVA_TOOL_OPTIONS slip in (as the JVM does by default)
if not "%JAVA_TOOL_OPTIONS%" == "" (
  echo "warning: ignoring JAVA_TOOL_OPTIONS=$JAVA_TOOL_OPTIONS"
  set JAVA_TOOL_OPTIONS=
)

```

---

<div class="post-metadata">

**Author:** ![asandhu](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@asandhu](https://discuss.elastic.co/u/asandhu)\
**Post date:** [June 10, 2024, 7:36pm UTC](https://discuss.elastic.co/t/logstash-error-oracle-was-unexpected-at-this-time/361185/4 "2024-06-10T19:36:51Z")

</div>

Thank You @Badger . Editing the setup.bat file did the trick
