Logstash Cannot Find Java (I know, it's common, but)

this seems to be a quite common issue many people face. I exhausted every single resource I could find on the topic with all suggested solutions, none worked for me. I probably am missing something tiny in some file, but I can't see a thing anymore. Please help, it would be HIGHLY appreciated.

Ok so this is my environment:

  1. Windows 10 Pro, using Windows PowerShell ISE, no-admin rights (normal user account).

  2. JAVA_HOME set in env at: C:\Program Files\Java\jdk-11.0.1\bin\javaw.exe
    I tried pointing it at ...jdk-11.0.1\bin and ...jdk-11.0.1, none worked.

  3. The previous paths were added and tested in the PATH env var, didn't work.

  4. The PATH env var also include: C:\Program Files (x86)\Common Files\Oracle\Java\javapath, which containes: java.exe, javaw.exe, javaws.exe
    It is not possible to remove this from PATH as I don't have admin rights on my pc.

  5. Filebeat, Elasticsearch, Kibana are all working fine, except Logstash. Before running FESK services I set the env var of JAVA_HOME='C:\Program Files\Java\jdk-11.0.1' through a poweshell ISE script. It works fine.

  6. All of my Elasticstack services are located at C:\Users\My Account\ES. Yes, there's an empty space between my first name and last name, which was set by our IT guy...

  7. A solution suggested substituting '!' with '%' or completely remove them from from JAVA_HOME in logstash.bat, didn't work.

  8. Another workaround suggested adding:
    JAVA_HOME='C:\Program Files\Java\jdk-11.0.1'
    in bin\logstash, didn't work.

  9. Using version 6.5.3 of everything, installed/run through downloading the zip folder.

I'm out of thoughts on why ES, FB, Kibana are all working fine and Logstash is so problematic.

Thank you.

Alright, I managed to do something and got a new error message. Changed few things in conf and env var, and got this:

unrecognized VM option 'UseParNewGC'

After some quick search others suggested that Java 8 is the only supported one by Logstash. I'm using JDK 11.0.1, as mentioned in the original post.

As some posts suggested, I'll try using JDK 8.191 instead. So, the only question here is: everything else (ES, Beats, Kibana) should work fine with jdk8, right? I'm asking because it's not easy for me to do so as I don't have admin rights on my pc (need to contact an admin).

Will try and keep this thread updated.

Thanks a bunch.

yes...!! ES, Beats, Kibana will work fine with jdk8

Things are running as expected.

Also, thanks for the git-thread link.

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