Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start logstash on Win10 with error: "could not find java; set JAVA_HOME or ensure java is in PATH" #16596

Closed
XddAdd opened this issue Oct 24, 2024 · 2 comments · Fixed by #16633

Comments

@XddAdd
Copy link

XddAdd commented Oct 24, 2024

Logstash information:

  1. Logstash version: logstash Version not detected
  2. Logstash installation source: expanded from "logstash-8.15.3-linux-x86_64.tar.gz"
  3. How is Logstash being run: bin\logstash.bat (Powershell)

Plugins installed:
Nothing

JVM (e.g. java -version):

  1. JVM version: openjdk version "11.0.0.1" 2023-05-09
  2. JVM installation source: expanded from zip
  3. Value of the LS_JAVA_HOME environment variable if set: not set

OS version (uname -a if on a Unix-like system):
Windows 10

Description of the problem including expected versus actual behavior:
Steps to reproduce:

  1. expand "logstash-8.15.3-linux-x86_64.tar.gz"
  2. run bin\logstash.bat on powershell

Provide logs (if relevant):
Using bundled JDK: xxxxx
could not find java; set JAVA_HOME or ensure java is in PATH

@XddAdd
Copy link
Author

XddAdd commented Oct 24, 2024

I confirm that I have set the JAVA_HOME environment variable and also added JAVA_HOME/bin to the PATH.

@kaisecheng
Copy link
Contributor

Please use -windows-x86_64.tar.gz for Windows OS. The tar gz bundles with jdk and should be able to run with bin\logstash.bat

However, when I checkout source code, build and run locally in Windows, I can see the log hinting to JAVA_HOME, which need to be fixed.

$ bin\logstash
"Using system java: "C:\Program Files\Common Files\Oracle\Java\javapath\java.exe""
The system cannot find the path specified.
could not find java; set JAVA_HOME or ensure java is in PATH

Since v8.0.0, users should set the value of LS_JAVA_HOME to the path of their preferred JDK if they wish to use a version other than the bundled JDK. The value of JAVA_HOME will be ignored.

Thanks again for reporting the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants