forked from opensearch-project/security
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes java path configuration to pick up bundled jdk when java home i…
…s not set Signed-off-by: Darshit Chanpura <[email protected]>
- Loading branch information
1 parent
c91394b
commit 1333181
Showing
2 changed files
with
48 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
@echo off | ||
set DIR=%~dp0 | ||
|
||
if defined OPENSEARCH_JAVA_HOME ( | ||
set BIN_PATH="%OPENSEARCH_JAVA_HOME%\bin\java.exe" | ||
) else if defined JAVA_HOME ( | ||
set BIN_PATH="%JAVA_HOME%\bin\java.exe" | ||
if not "%OPENSEARCH_JAVA_HOME%" == "" ( | ||
set "JAVA=%OPENSEARCH_JAVA_HOME%\bin\java.exe" | ||
set JAVA_TYPE=OPENSEARCH_JAVA_HOME | ||
) else if not "%JAVA_HOME%" == "" ( | ||
set "JAVA=%JAVA_HOME%\bin\java.exe" | ||
set JAVA_TYPE=JAVA_HOME | ||
) else ( | ||
echo Unable to find java runtime | ||
echo OPENSEARCH_JAVA_HOME or JAVA_HOME must be defined | ||
set "JAVA=%OPENSEARCH_HOME%\jdk\bin\java.exe" | ||
set "JAVA_HOME=%OPENSEARCH_HOME%\jdk" | ||
set JAVA_TYPE=bundled jdk | ||
) | ||
|
||
if not exist !JAVA! ( | ||
echo "could not find java in !JAVA_TYPE! at !JAVA!" >&2 | ||
exit /b 1 | ||
) | ||
|
||
%BIN_PATH% -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=OFF -cp "%DIR%\..\*;%DIR%\..\..\..\lib\*;%DIR%\..\deps\*" org.opensearch.security.tools.democonfig.Installer %DIR% %* 2> nul | ||
%JAVA% -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=OFF -cp "%DIR%\..\*;%DIR%\..\..\..\lib\*;%DIR%\..\deps\*" org.opensearch.security.tools.democonfig.Installer %DIR% %* 2> nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters