[Enhancement] Infer JAVA_HOME if not set (#27069)

Signed-off-by: Alex Zhu <zhuming9011@gmail.com>
This commit is contained in:
Alex Zhu 2023-07-12 22:48:27 +08:00 committed by GitHub
parent 8db329beec
commit 6737789a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

6
env.sh
View File

@ -68,7 +68,11 @@ fi
export CLANG_COMPATIBLE_FLAGS=`echo | ${STARROCKS_GCC_HOME}/bin/gcc -Wp,-v -xc++ - -fsyntax-only 2>&1 \
| grep -E '^\s+/' | awk '{print "-I" $1}' | tr '\n' ' '`
# check java home
if [[ -z ${JAVA_HOME} ]]; then
export JAVA_HOME="$(dirname $(dirname $(readlink -f $(which javac))))"
echo "Infered JAVA_HOME=$JAVA_HOME"
fi
if [[ -z ${JAVA_HOME} ]]; then
echo "Error: JAVA_HOME is not set"
exit 1