0

I installed Java SRE and JDK. I rebooted the server. I am still getting the "could not find java; set JAVA_HOME or ensure java is in PATH" error. What else should I look for to solve this? Thanks

Here's my PS output. I shortened the Path to just show anything related to Java.

PS C:\Windows\system32> cd C:\ElkStack\logstash-5.6.2
PS C:\ElkStack\logstash-5.6.2> .\bin\logstash.bat
could not find java; set JAVA_HOME or ensure java is in PATH

PS C:\ElkStack\logstash-5.6.2> $ENV:Path
C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\
Program Files (x86)\Java\jre1.8.0_361\bin

PS C:\ElkStack\logstash-5.6.2> $ENV:JAVA_HOME
C:\Program Files (x86)\Java\jre1.8.0_361

My C:\Program Files\Common Files\Oracle\Java\javapath shortcut shows java.exe correctly.

I tried changing the JAVA_HOME to c:\progra~1\Common~1\Oracle\Java\javapath and restarting my PS instance with the same results.

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
Kris Kilton
  • 938
  • 9
  • 11
  • Does this answer your question? [Windows JAVA HOME problems](https://stackoverflow.com/questions/1229019/windows-java-home-problems) – Alejandro Feb 09 '23 at 18:14
  • This might help: [cannot-locate-java-installation-error-for-logstash](https://stackoverflow.com/questions/30427355/cannot-locate-java-installation-error-for-logstash) – Michael Markidis Feb 09 '23 at 18:20
  • @Alejandro I went through that post and nothing helped – Kris Kilton Feb 09 '23 at 20:42
  • @MichaelMarkidis I checked that one too, if you look at my PS code, and other attempts to fix it below, I tried all the ideas in that post – Kris Kilton Feb 09 '23 at 20:44

0 Answers0