This is an automated email from the ASF dual-hosted git repository. szetszwo pushed a commit to branch branch-2_readIndex in repository https://gitbox.apache.org/repos/asf/ratis.git
commit 5d9e4b5383cf8e2395fbed4013a750ad92ff15d4 Author: Kaijie Chen <[email protected]> AuthorDate: Mon Mar 13 17:47:14 2023 +0800 RATIS-1813. Allow ratis-shell to run in JDK 8+ (#851) (cherry picked from commit bde35c6662489a6198fa7960bed767f152e4d180) --- ratis-shell/src/main/libexec/ratis-shell-config.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ratis-shell/src/main/libexec/ratis-shell-config.sh b/ratis-shell/src/main/libexec/ratis-shell-config.sh index 27d2ee0a1..71fda692b 100644 --- a/ratis-shell/src/main/libexec/ratis-shell-config.sh +++ b/ratis-shell/src/main/libexec/ratis-shell-config.sh @@ -50,12 +50,12 @@ if [[ -z "${JAVA}" ]]; then fi fi -# Check Java version == 1.8 or == 11 +# Check Java version == 1.8 or >= 8 JAVA_VERSION=$(${JAVA} -version 2>&1 | awk -F '"' '/version/ {print $2}') -JAVA_MAJORMINOR=$(echo "${JAVA_VERSION}" | awk -F. '{printf("%03d%03d",$1,$2);}') -JAVA_MAJOR=$(echo "${JAVA_VERSION}" | awk -F. '{printf("%03d",$1);}') -if [[ ${JAVA_MAJORMINOR} != 001008 && ${JAVA_MAJOR} != 011 ]]; then - echo "Error: ratis-shell requires Java 8 or Java 11, currently Java $JAVA_VERSION found." +JAVA_MAJORMINOR=$(echo "${JAVA_VERSION}" | awk -F. '{printf "%d.%d",$1,$2}') +JAVA_MAJOR=$(echo "${JAVA_VERSION}" | awk -F. '{print $1}') +if [[ ${JAVA_MAJORMINOR} != 1.8 && ${JAVA_MAJOR} -lt 8 ]]; then + echo "Error: ratis-shell requires Java 8+, currently Java $JAVA_VERSION found." exit 1 fi
