pan3793 commented on code in PR #5308:
URL: https://github.com/apache/kyuubi/pull/5308#discussion_r1329586871
##########
build/release/release.sh:
##########
@@ -52,6 +52,23 @@ if [[ ${RELEASE_VERSION} =~ .*-SNAPSHOT ]]; then
exit 1
fi
+# Find the java binary
+if [ -n "${JAVA_HOME}" ]; then
+ JAVA="${JAVA_HOME}/bin/java"
+elif [ "$(command -v java)" ]; then
+ JAVA="java"
+else
+ echo "JAVA_HOME is not set" >&2
+ exit 1
+fi
+
+# Required java 1.8 version
+JAVA_VERSION=$($JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}')
+if [[ $JAVA_VERSION != 1.8.* ]]; then
+ echo "Java version $JAVA_VERSION is not required 1.8"
+ exit 1
+fi
Review Comment:
```suggestion
if [ -n "${JAVA_HOME}" ]; then
JAVA="${JAVA_HOME}/bin/java"
elif [ "$(command -v java)" ]; then
JAVA="java"
else
echo "JAVA_HOME is not set" >&2
exit 1
fi
JAVA_VERSION=$($JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ $JAVA_VERSION != 1.8.* ]]; then
echo "Unexpected Java version: $JAVA_VERSION. Java 8 is required for
release."
exit 1
fi
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]