diff --git a/bin/hbase b/bin/hbase index 1f8b9dadb066..606de0a9e85c 100755 --- a/bin/hbase +++ b/bin/hbase @@ -492,6 +492,10 @@ add_jdk11_deps_to_classpath() { done } +add_jdk11_jvm_flags() { + HBASE_OPTS="$HBASE_OPTS --illegal-access=permit --add-modules jdk.unsupported -Dio.netty.tryReflectionSetAccessible=true --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-exports java.base/jdk.internal.misc=ALL-UNNAMED" +} + add_opentelemetry_agent() { if [ -e "${OPENTELEMETRY_JAVAAGENT_PATH}" ] ; then agent_jar="${OPENTELEMETRY_JAVAAGENT_PATH}" @@ -811,11 +815,14 @@ fi if [ "${addJDK11Jars}" = "true" ]; then add_jdk11_deps_to_classpath + add_jdk11_jvm_flags if [ "${DEBUG}" = "true" ]; then - echo "Added JDK11 jars to classpath." - fi + echo "Added JDK11 jars to classpath." + echo "Added JDK11 JVM flags too." + fi elif [ "${DEBUG}" = "true" ]; then echo "JDK11 jars skipped from classpath." + echo "Skipped adding JDK11 JVM flags." fi if [[ -n "${HBASE_TRACE_OPTS}" ]]; then diff --git a/pom.xml b/pom.xml index 20b1bc5a0f41..bd51dc0d7dae 100644 --- a/pom.xml +++ b/pom.xml @@ -3030,7 +3030,7 @@ ${releaseTarget} - --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED ${hbase-surefire.argLine} + --illegal-access=permit --add-modules jdk.unsupported -Dio.netty.tryReflectionSetAccessible=true --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-exports java.base/jdk.internal.misc=ALL-UNNAMED ${hbase-surefire.argLine} 3.2.0