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.
I thought I had multiple versions of Java on my system which might be the cause but I have removed the new versions.
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.
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
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
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=
)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.