[ASTERIXDB-2742] Relax Java version check

Change-Id: I5cbbc367944b489aee651ea050e74990dcf65531
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/6763
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
diff --git a/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh b/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
index 34c3a0f..65ef608 100755
--- a/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
+++ b/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
@@ -86,10 +86,9 @@
 fi
 
 export JAVA_VERSION=$($JAVACMD -version 2>&1 | head -1 | awk '{ print $3 }' | tr -d '"')
+
 case $JAVA_VERSION in
-  1.8*|1.9*|10*|11*)
-    ;;
-  *)
+  1.[0-7]*)
   echo JAVA_HOME must be at version 1.8 or later, but is: $JAVA_VERSION
   exit 2
 esac
diff --git a/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
index 97473ac..b79ca0b 100755
--- a/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
+++ b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
@@ -99,14 +99,15 @@
     JAVACMD=`which java`
   fi
 fi
+
 export JAVA_VERSION=$($JAVACMD -version 2>&1 | head -1 | awk '{ print $3 }' | tr -d '"')
+
 case $JAVA_VERSION in
-  1.8*|1.9*|10*|11*)
-    ;;
-  *)
+  1.[0-7]*)
   echo JAVA_HOME must be at version 1.8 or later, but is: $JAVA_VERSION
   exit 2
 esac
+
 DIRNAME=$(dirname "$0")
 [ $(echo $DIRNAME | wc -l) -ne 1 ] && {
   echo "Paths with spaces are not supported"