0

I'm trying to install Logstash in my system and when I'm trying to run logstash.bat, I'm getting the below error:

Error: Could not find or load main class 7.1.0\logstash-7.2.0\logstash-7.2.0\log stash-core\lib\jars\animal-sniffer-annotations-1.14.jar;D:\ELK

Whats the reason?

I have added the below code on the logstash.bat file as well.

set JAVA_HOME=path\to\custom_jdk_folder\jdk_8u161set 
CLASSPATH=%JAVA_HOME%\bin

But the error still exists.

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
AlisonGrey
  • 497
  • 1
  • 7
  • 23

1 Answers1

1

The reason is that ... somehow ... the batch file has gotten the Java command line wrong. It looks like it has misinterpreted something as the class name.

The current version of the logstash.bat file is here. As you can see, it is assembling the Java command line from a variety of things including:

  • parameters on the command line,
  • the logstash "jvm.options" file, and
  • the list of logstash's JAR files from "logstash-core\lib\jars"

It is unclear what has actually gone wrong, but this kind of problem often happens if there is an unexpected (unquoted) space in the Java command line.

My recommendation would be to debug what the BAT file is actually doing, starting by finding out what the command line actually looks like.

Also, take a look at the explanation of what the command line should look like in:

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216