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


##########
bin/cassandra.in.sh:
##########
@@ -122,13 +122,22 @@ jvmver=`echo "$java_ver_output" | grep '[openjdk|java] 
version' | awk -F'"' 'NR=
 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."
     exit 1;
 fi
+# Allow execution if a supported Java version is used or CASSANDRA_USE_ALL_JDK 
argument is set
+java_versions_supported=11,17
+supported_version=$(echo "$java_versions_supported" | tr "," '\n' | grep -F -x 
"$short")
+
+if [ "x$CASSANDRA_USE_ALL_JDK" != "xtrue" ] && [ "x$supported_version" = "x" ] 
; then
+    echo "Cassandra 5.0 requires Java 11, Java 17 (or newer LTS)."

Review Comment:
   ```suggestion
       echo "Cassandra 5.0 requires Java 11 or Java 17."
   ```
   
   
   comment applies to all places.



##########
bin/cassandra.in.sh:
##########
@@ -122,13 +122,22 @@ jvmver=`echo "$java_ver_output" | grep '[openjdk|java] 
version' | awk -F'"' 'NR=
 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."
     exit 1;
 fi
+# Allow execution if a supported Java version is used or CASSANDRA_USE_ALL_JDK 
argument is set
+java_versions_supported=11,17
+supported_version=$(echo "$java_versions_supported" | tr "," '\n' | grep -F -x 
"$short")
+
+if [ "x$CASSANDRA_USE_ALL_JDK" != "xtrue" ] && [ "x$supported_version" = "x" ] 
; then

Review Comment:
   ```suggestion
   if [ "x$CASSANDRA_USE_ALL_JDK" != "x" ] && [ "x$supported_version" = "x" ] ; 
then
   ```
   
   just take any non-blank value as "the env variable is activated".  better to 
catch all the possible legit values than worry about the using trying to get 
"=false" working.
   
   comment applies to all places.



-- 
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