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

error when JAVA_HOME is set to invalid value (DAT-10545) #3074

Merged
merged 5 commits into from Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions liquibase-dist/src/main/archive/liquibase
Expand Up @@ -30,6 +30,11 @@ if [ -z "${JAVA_HOME}" ]; then
elif [ -d "${LIQUIBASE_HOME}/.install4j/jre.bundle/Contents/Home" ]; then
JAVA_HOME="${LIQUIBASE_HOME}/.install4j/jre.bundle/Contents/Home"
fi
else
if [ ! -x "$JAVA_HOME" ] ; then
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 1
fi
fi

if [ -z "${JAVA_HOME}" ]; then
Expand Down
5 changes: 5 additions & 0 deletions liquibase-dist/src/main/archive/liquibase.bat
Expand Up @@ -17,6 +17,11 @@ if exist "%LIQUIBASE_HOME%\jre" if "%JAVA_HOME%"=="" (
set JAVA_HOME=%LIQUIBASE_HOME%\jre
)

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
)

rem special characters may be lost
setlocal DISABLEDELAYEDEXPANSION

Expand Down