Logstash : “Error: Could not find or load main class Heal” when running logstash.bat



I just downloaded logstash 7.6.0 in windows 10. I already have elastic search (7.6.0) and kibana (7.6.0) running. When I run logstash.bat with default configuration it gives this error.

Error: Could not find or load main class Heal

I have jdk 11 installed and I checked that the environment variable is set. Please help.

EDIT: Added config file

input{
    file =>"D://logfile-2020-03-22.log"
    start_position => "beginning"
    type => "json"
}

output{
    elasticsearch {
        hosts => ["localhost:9200"]
    }
}

Actually this same configuration is working fine on one of our servers. But when I am trying to set it up locally it is giving this error. The only differences I can find is the OS (Windows server 2012 r2 vs windows 10) and the version of ELK stack (7.6.1 on server and 7.6.0 locally)

Answer

It looks like the issue was with my Java installation, I uninstalled my java (java 8) and downloaded java version 11 and it solved the issue.



Source: stackoverflow