You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2022/04/21 15:55:10 UTC

[hbase] branch branch-2 updated: HBASE-25058 Export necessary modules when running under JDK11 (#4337)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new edbe44b0d14 HBASE-25058 Export necessary modules when running under JDK11 (#4337)
edbe44b0d14 is described below

commit edbe44b0d1407a1d085a9824a11da415f80a3cab
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Thu Apr 21 23:49:27 2022 +0800

    HBASE-25058 Export necessary modules when running under JDK11 (#4337)
    
    Singed-off-by: Nick Dimiduk <nd...@apache.org>
    (cherry picked from commit 82e47cde27c1db91a685cff38c44a5572194f988)
---
 bin/hbase | 11 +++++++++--
 pom.xml   | 11 ++++++++++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/bin/hbase b/bin/hbase
index f1ffb11f3d1..af530f62abc 100755
--- a/bin/hbase
+++ b/bin/hbase
@@ -490,6 +490,10 @@ add_jdk11_deps_to_classpath() {
   done
 }
 
+add_jdk11_jvm_flags() {
+  HBASE_OPTS="$HBASE_OPTS -Dio.netty.tryReflectionSetAccessible=true --illegal-access=permit --add-modules jdk.unsupported --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=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}"
@@ -783,11 +787,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 afe98e7ace7..70f2cb8852d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2851,7 +2851,16 @@
       <properties>
         <maven.compiler.release>${releaseTarget}</maven.compiler.release>
         <!-- TODO: replicate logic for windows support -->
-        <argLine>--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED ${hbase-surefire.argLine}</argLine>
+        <argLine>-Dio.netty.tryReflectionSetAccessible=true
+          --illegal-access=permit
+          --add-modules jdk.unsupported
+          --add-opens java.base/java.nio=ALL-UNNAMED
+          --add-opens java.base/sun.nio.ch=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}</argLine>
         <!-- We need a minimum HDFS version of 3.2.0 for HADOOP-12760 -->
         <hadoop-three.version>3.2.0</hadoop-three.version>
         <!--