You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "shyla226 (via GitHub)" <gi...@apache.org> on 2023/09/19 20:57:27 UTC

[GitHub] [cassandra] shyla226 commented on a diff in pull request #2563: Fix for CASSANDRA-18688: Limit Java runtime in 5.0 to JDK17 in scripts; add a flag to opt out of that

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


##########
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)."
+    echo "If you would like to test with other Java versions >17, set \$CASSANDRA_USE_ALL_JDK=true"

Review Comment:
   Added



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org