diff --git a/bin/common.sh b/bin/common.sh index e872779531a..0a8001717e7 100755 --- a/bin/common.sh +++ b/bin/common.sh @@ -71,8 +71,8 @@ source ${BK_CONFDIR}/bkenv.sh source ${BK_CONFDIR}/bk_cli_env.sh detect_jdk8() { - - if [ -f "$JAVA_HOME/lib/modules" ]; then + local is_java_8=$($JAVA -version 2>&1 | grep version | grep '"1\.8') + if [ -z "$is_java_8" ]; then echo "0" else echo "1"