Support Java 11 or 17 as pre-requisite

Change-Id: I4718f6eb23b0d42640547ec70488900d521de8ed
diff --git a/fpm/scripts/before-install.sh b/fpm/scripts/before-install.sh
index e8074fd..3a0d045 100755
--- a/fpm/scripts/before-install.sh
+++ b/fpm/scripts/before-install.sh
@@ -25,9 +25,9 @@
 JAVA_VERSION=$(java -version 2>&1)
 [ $? != 0 ] && echo -e "NOT FOUND\nPlease install Java 11 and try again" && exit 2
 
-VERSION=`expr "$JAVA_VERSION" : '.*"\(11\..*\)["_]'`
+VERSION=`expr "$JAVA_VERSION" : '.*"\(1[17]\..*\)["_]'`
 echo "$VERSION"
-test "$VERSION" "<" "11" && echo "ERROR: Java 11 required by Gerrit" && exit 3
+test "$VERSION" "<" "11" && echo "ERROR: Java 11 or 17 required by Gerrit" && exit 3
 
 # Script is invoked even before upgrade, we need to stop Gerrit if active
 if [ -e /etc/init.d/gerrit ]