Logstash.bat immediately errors out with \Java\jdk-11.0.12 was unexpected at this time

Just trying my first local run of logstash after installation on windows 10. I performed the first steps to validate jvm:

PS C:\logstash-7.14.0> Write-Host $env:JAVA_HOME
C:\Program Files (x86)\Java\jdk-11.0.12

PS C:\logstash-7.14.0> java -version
java version "11.0.12" 2021-07-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode)

Then when executing logstash.bat, receive the following:
PS C:\logstash-7.14.0> .\bin\logstash.bat --help
\Java\jdk-11.0.12 was unexpected at this time.

same if I point %JAVA_HOME% to another local java version:
PS C:\logstash-7.14.0> Write-Host $env:JAVA_HOME
C:\Program Files (x86)\Java\jdk1.8.0_291
PS C:\logstash-7.14.0> java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) Client VM (build 25.291-b10, mixed mode, sharing)
PS C:\logstash-7.14.0> .\bin\logstash.bat --help
\Java\jdk1.8.0_291 was unexpected at this time.

See this thread. I suggest you unset JAVA_HOME.

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