michaelsembwever commented on code in PR #2563:
URL: https://github.com/apache/cassandra/pull/2563#discussion_r1417243272


##########
redhat/cassandra.in.sh:
##########
@@ -74,19 +74,34 @@ if [ -z $JAVA ] ; then
     exit 1;
 fi
 
+# Matches variable 'java.supported' in build.xml
+java_versions_supported=11,17
+
 # Determine the sort of JVM we'll be running on.
 java_ver_output=`"${JAVA:-java}" -version 2>&1`
 jvmver=`echo "$java_ver_output" | grep '[openjdk|java] version' | awk -F'"' 
'NR==1 {print $2}' | cut -d\- -f1`
 JVM_VERSION=${jvmver%_*}
 short=$(echo "${jvmver}" | cut -c1-2)
 
-JAVA_VERSION=17
-if [ "$short" = "11" ]  ; then
-     JAVA_VERSION=11
-elif [ "$JVM_VERSION" \< "17" ] ; then
-    echo "Cassandra 5.0 requires Java 11 or Java 17."
+# Unsupported JDKs below the upper supported version are not allowed
+if [ "$short" != "$(echo "$java_versions_supported" | cut -d, -f1)" ] && [ 
"$JVM_VERSION" \< "$(echo "$java_versions_supported" | cut -d, -f2)" ] ; then
+    echo "Unsupported Java $JVM_VERSION. Supported are 
$java_versions_supported"
     exit 1;
 fi
+# Allow execution of supported Java versions, and newer if 
CASSANDRA_JDK_UNSUPPORTED is set
+supported_version=$(echo "$java_versions_supported" | tr "," '\n' | grep -F -x 
"$short")
+if [ -z "$supported_version" ] ; then

Review Comment:
   see above.  `supported_version`  is correct and nothing should be changed 
here (IMHO)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to