Skip to content

Commit

Permalink
Fix liquibase 4.23.1 won't work on windows if there is no JAVA_HOME s…
Browse files Browse the repository at this point in the history
…ystem variable set (liquibase#4803)

Fix problem in some cmd versions
  • Loading branch information
filipelautert committed Aug 31, 2023
1 parent a01a837 commit 7e709fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions liquibase-dist/src/main/archive/liquibase.bat
Expand Up @@ -9,14 +9,14 @@ set LIQUIBASE_HOME="%~dp0"
rem remove quotes around LIQUIBASE_HOME
set LIQUIBASE_HOME=%LIQUIBASE_HOME:"=%

rem remove quotes around JAVA_HOME if set
if NOT "%JAVA_HOME%" == "" set JAVA_HOME=%JAVA_HOME:"=%

rem set JAVA_HOME to local jre dir if not set
if exist "%LIQUIBASE_HOME%\jre" if "%JAVA_HOME%"=="" (
set JAVA_HOME="%LIQUIBASE_HOME%\jre"
)

rem remove quotes around JAVA_HOME if set
if NOT "%JAVA_HOME%" == "" set JAVA_HOME=%JAVA_HOME:"=%

if NOT "%JAVA_HOME%" == "" if not exist "%JAVA_HOME%" (
echo ERROR: The JAVA_HOME environment variable is not defined correctly, so Liquibase cannot be started. JAVA_HOME is set to "%JAVA_HOME%" and it does not exist. >&2
exit /B 1
Expand Down

0 comments on commit 7e709fe

Please sign in to comment.