kcadm.bat, kcreg.bat do not respect environment variables JAVA, JAVA_… (#23630)
* kcadm.bat, kcreg.bat do not respect environment variables JAVA, JAVA_HOME to select JVM * edited kcadm.bat and kcreg.bat scripts Closes #23214 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * kcadm.bat, kcreg.bat do not respect environment variables JAVA, JAVA_HOME to select JVM * incorporated suggestions Closes #23214 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> * kcadm.bat, kcreg.bat do not respect environment variables JAVA, JAVA_HOME to select JVM * incorporated suggestions Closes #23214 Signed-off-by: Peter Zaoral <pzaoral@redhat.com> --------- Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
This commit is contained in:
parent
c18e8ff535
commit
f2dc57bfe1
3 changed files with 62 additions and 16 deletions
|
@ -5,4 +5,26 @@ if "%OS%" == "Windows_NT" (
|
|||
) else (
|
||||
set DIRNAME=.\
|
||||
)
|
||||
java %KC_OPTS% -cp "%DIRNAME%\client\keycloak-admin-cli-${project.version}.jar" --add-opens=java.base/java.security=ALL-UNNAMED -Dkc.lib.dir="%DIRNAME%\client\lib" org.keycloak.client.admin.cli.KcAdmMain %*
|
||||
|
||||
if "x%JAVA%" == "x" (
|
||||
if "x%JAVA_HOME%" == "x" (
|
||||
set JAVA=java
|
||||
echo JAVA_HOME is not set. Unexpected results may occur. 1>&2
|
||||
echo Set JAVA_HOME to the directory of your local JDK to avoid this message. 1>&2
|
||||
) else (
|
||||
if not exist "%JAVA_HOME%" (
|
||||
echo JAVA_HOME "%JAVA_HOME%" path doesn't exist 1>&2
|
||||
goto END
|
||||
) else (
|
||||
if not exist "%JAVA_HOME%\bin\java.exe" (
|
||||
echo "%JAVA_HOME%\bin\java.exe" does not exist 1>&2
|
||||
goto END
|
||||
)
|
||||
set "JAVA=%JAVA_HOME%\bin\java"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
"%JAVA%" %KC_OPTS% -cp "%DIRNAME%\client\keycloak-admin-cli-${project.version}.jar" --add-opens=java.base/java.security=ALL-UNNAMED -Dkc.lib.dir="%DIRNAME%\client\lib" org.keycloak.client.admin.cli.KcAdmMain %*
|
||||
|
||||
:END
|
||||
|
|
|
@ -5,4 +5,26 @@ if "%OS%" == "Windows_NT" (
|
|||
) else (
|
||||
set DIRNAME=.\
|
||||
)
|
||||
java %KC_OPTS% -cp "%DIRNAME%\client\keycloak-client-registration-cli-${project.version}.jar" --add-opens=java.base/java.security=ALL-UNNAMED -Dkc.lib.dir="%DIRNAME%\client\lib" org.keycloak.client.registration.cli.KcRegMain %*
|
||||
|
||||
if "x%JAVA%" == "x" (
|
||||
if "x%JAVA_HOME%" == "x" (
|
||||
set JAVA=java
|
||||
echo JAVA_HOME is not set. Unexpected results may occur. 1>&2
|
||||
echo Set JAVA_HOME to the directory of your local JDK to avoid this message. 1>&2
|
||||
) else (
|
||||
if not exist "%JAVA_HOME%" (
|
||||
echo JAVA_HOME "%JAVA_HOME%" path doesn't exist 1>&2
|
||||
goto END
|
||||
) else (
|
||||
if not exist "%JAVA_HOME%\bin\java.exe" (
|
||||
echo "%JAVA_HOME%\bin\java.exe" does not exist 1>&2
|
||||
goto END
|
||||
)
|
||||
set "JAVA=%JAVA_HOME%\bin\java"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
"%JAVA%" %KC_OPTS% -cp "%DIRNAME%\client\keycloak-client-registration-cli-${project.version}.jar" --add-opens=java.base/java.security=ALL-UNNAMED -Dkc.lib.dir="%DIRNAME%\client\lib" org.keycloak.client.registration.cli.KcRegMain %*
|
||||
|
||||
:END
|
||||
|
|
14
quarkus/dist/src/main/content/bin/kc.bat
vendored
14
quarkus/dist/src/main/content/bin/kc.bat
vendored
|
@ -119,21 +119,23 @@ if "%DEBUG_MODE%" == "true" (
|
|||
rem Setup Keycloak specific properties
|
||||
set JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%
|
||||
|
||||
if "x%JAVA_HOME%" == "x" (
|
||||
if "x%JAVA%" == "x" (
|
||||
if "x%JAVA_HOME%" == "x" (
|
||||
set JAVA=java
|
||||
echo JAVA_HOME is not set. Unexpected results may occur.
|
||||
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
|
||||
) else (
|
||||
echo JAVA_HOME is not set. Unexpected results may occur. 1>&2
|
||||
echo Set JAVA_HOME to the directory of your local JDK to avoid this message. 1>&2
|
||||
) else (
|
||||
if not exist "%JAVA_HOME%" (
|
||||
echo JAVA_HOME "%JAVA_HOME%" path doesn't exist
|
||||
echo JAVA_HOME "%JAVA_HOME%" path doesn't exist 1>&2
|
||||
goto END
|
||||
) else (
|
||||
if not exist "%JAVA_HOME%\bin\java.exe" (
|
||||
echo "%JAVA_HOME%\bin\java.exe" does not exist
|
||||
echo "%JAVA_HOME%\bin\java.exe" does not exist 1>&2
|
||||
goto END
|
||||
)
|
||||
set "JAVA=%JAVA_HOME%\bin\java"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
set "CLASSPATH_OPTS=%DIRNAME%..\lib\quarkus-run.jar"
|
||||
|
|
Loading…
Reference in a new issue