Skip to content

Commit

Permalink
[#1405] Print warning message instead of failing the bootstrap when u…
Browse files Browse the repository at this point in the history
…sing 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
  • Loading branch information
pan3793 authored Jan 9, 2024
1 parent f4bc086 commit c62aa87
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit c62aa87

Please sign in to comment.