Logstash Keystore No java.exe executable found on PATH

Hello,
I am trying to use the keystore, that the passwords in the pipeline are not in plain text. I did not download any JDK. I used the bundled jdk which is included in the logstash download. I am getting these message:

C:\path to logstash\logstash-8.0.1>bin\logstash-keystore.bat create
"Using bundled JDK: ."
No `java.exe' executable found on PATH.

My logstash-keystore.bat looks like that. From previous problems I know I somehow need to change the path there. My problem is where in this code and what exactly?

@echo off
setlocal enabledelayedexpansion

call "%~dp0setup.bat" || exit /b 1
if errorlevel 1 (
	if not defined nopauseonerror (
		pause
	)
	exit /B %ERRORLEVEL%
)

%JRUBY_BIN% "%LS_HOME%\lib\secretstore\cli.rb" %*
if errorlevel 1 (
  exit /B 1
)

endlocal

Hello !

The error speaks for itselfs, your system is not able to call the java executable from your PATH variable.

You need to make sure your system is aware of your java installation by setting system variable JAVA_HOME or edit your PATH system variable to append the JAVA executable directory.

This might help IBM Docs !

Ok, I was trying it out quiet a view times. Seems like I do not understand it really.

I created User and System variable called JAVA_HOME, with the value: C:\path to logstash\logstash-8.0.1\jdk
And added to user and system variable path following: %JAVA_HOME%\bin

As there is the bundled java.exe located, from my understanding

When I want to run the command to create logstash-keystore I am getting this now:

C:\path to logstash\logstash-8.0.1>bin\logstash-keystore.bat create
"Using bundled JDK: ."
Cannot locate Java installation, specified by JAVA_HOME:
C:\path to logstash\logstash-8.0.1\jdk\bin

What am I doing wrong? I thought I can just use the bundled java jdk?

Hello,

JAVA_HOME describe the installation path of your java environment depending on what you're running you'll end up with something like

C:\Program Files\Java\"myjavainstallation"

Do you understand that in order to run a program based on java this program needs to know where to run java from using JAVA_HOME

Ok thanks. I needed to install a java jdk, in order that this worked. I was hoping, it would work with the bundled JDK (Temurin) from logstash.

Glad you manage to do it, i dont know much about running logstash on Windows so i'm kind of clueless about why it didnt work with the shipped version of JDK in logstash :man_shrugging:

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