From c62aa875edd5c47ab6bcd22d6d847f44b67b79d9 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Tue, 9 Jan 2024 23:36:47 +0800 Subject: [PATCH] [#1405] Print warning message instead of failing the bootstrap when using Java prior 8u151 (#1406) ### What changes were proposed in this pull request? Print warning message instead of failing the bootstrap when using Java prior 8u151 ### Why are the changes needed? Fix: #1405 ### Does this PR introduce _any_ user-facing change? Yes, users who want to use Java prior 8u151 to bootstrap Gravitino just get an warning message instead of failing. ### How was this patch tested? Manually review --- bin/common.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/common.sh b/bin/common.sh index 6f9f37eb7c1..7aa3681afa9 100644 --- a/bin/common.sh +++ b/bin/common.sh @@ -56,11 +56,15 @@ function check_java_version() { JVM_VERSION=$(echo "$jvmver"|sed -e 's|^1\.\([0-9][0-9]*\)\..*$|\1|') fi + if [ "$JVM_VERSION" -lt 8 ]; then + echo "Gravitino requires either Java 8 or newer" + exit 1 + fi + # JDK 8u151 version fixed a number of security vulnerabilities and issues to improve system stability and security. # https://www.oracle.com/java/technologies/javase/8u151-relnotes.html - if [ "$JVM_VERSION" -lt 8 ] || { [ "$JVM_VERSION" -eq 8 ] && [ "${jvmver#*_}" -lt 151 ]; } ; then - echo "Gravitino requires either Java 8 update 151 or newer" - exit 1; + if [[ "$JVM_VERSION" -eq 8 && "${jvmver#*_}" -lt 151 ]]; then + echo "[WARNING] Gravitino highly recommends using either Java 8 update 151 or newer" fi }