From 286bf05740b059c551d3768bb93db4327858cf16 Mon Sep 17 00:00:00 2001 From: Ekaterina Dimitrova Date: Mon, 22 Jul 2024 17:11:38 -0400 Subject: [PATCH] Fix tools/bin/cassandra.in.sh; fix some JDK internals openings for audit logger and vectorizedMismatch --- build.xml | 1 + conf/jvm22-server.options | 1 + tools/bin/cassandra.in.sh | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/build.xml b/build.xml index d227582aa95f..f976a3c63090 100644 --- a/build.xml +++ b/build.xml @@ -285,6 +285,7 @@ --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.unsupported/sun.misc=ALL-UNNAMED + --add-exports java.base/jdk.internal.util.jar=ALL-UNNAMED --add-opens java.base/jdk.internal.module=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED diff --git a/conf/jvm22-server.options b/conf/jvm22-server.options index 79b83707f0a6..1e5260882fe1 100644 --- a/conf/jvm22-server.options +++ b/conf/jvm22-server.options @@ -50,6 +50,7 @@ --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming --add-exports jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED +--add-exports java.base/jdk.internal.util.jar=ALL-UNNAMED --add-opens java.base/jdk.internal.loader=ALL-UNNAMED --add-opens java.base/jdk.internal.ref=ALL-UNNAMED diff --git a/tools/bin/cassandra.in.sh b/tools/bin/cassandra.in.sh index 4370fc144b02..31e9728b94c6 100644 --- a/tools/bin/cassandra.in.sh +++ b/tools/bin/cassandra.in.sh @@ -76,12 +76,16 @@ if [ -z $JAVA ] ; then exit 1; fi +java_versions_supported=11,17,22 + # 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=22 -JAVA_VERSION=11 if [ "$JVM_VERSION" = "1.8.0" ] ; then JVM_PATCH_VERSION=${jvmver#*_} if [ "$JVM_VERSION" \< "1.8" ] || [ "$JVM_VERSION" \> "1.8.2" ] ; then @@ -96,6 +100,10 @@ if [ "$JVM_VERSION" = "1.8.0" ] ; then elif [ "$JVM_VERSION" \< "11" ] ; then echo "Cassandra 4.0 requires either Java 8 (update 151 or newer) or Java 11 (or newer)." exit 1; +elif [ "$short" = "11" ] ; then + JAVA_VERSION=11 +elif [ "$JVM_VERSION" \< "22" ] ; then + echo "Cassandra requires Java 11 or Java 22(or newer)." fi jvm=`echo "$java_ver_output" | grep -A 1 '[openjdk|java] version' | awk 'NR==2 {print $1}'`