Skip to content

Commit 96628db

Browse files
committed
HBASE-25058 Export necessary modules when running under JDK11 (#4337)
Singed-off-by: Nick Dimiduk <ndimiduk@apache.org> (cherry picked from commit 82e47cd)
1 parent 5c0c15b commit 96628db

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

bin/hbase

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,10 @@ add_jdk11_deps_to_classpath() {
490490
done
491491
}
492492

493+
add_jdk11_jvm_flags() {
494+
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"
495+
}
496+
493497
add_opentelemetry_agent() {
494498
if [ -e "${OPENTELEMETRY_JAVAAGENT_PATH}" ] ; then
495499
agent_jar="${OPENTELEMETRY_JAVAAGENT_PATH}"
@@ -783,11 +787,14 @@ fi
783787

784788
if [ "${addJDK11Jars}" = "true" ]; then
785789
add_jdk11_deps_to_classpath
790+
add_jdk11_jvm_flags
786791
if [ "${DEBUG}" = "true" ]; then
787-
echo "Added JDK11 jars to classpath."
788-
fi
792+
echo "Added JDK11 jars to classpath."
793+
echo "Added JDK11 JVM flags too."
794+
fi
789795
elif [ "${DEBUG}" = "true" ]; then
790796
echo "JDK11 jars skipped from classpath."
797+
echo "Skipped adding JDK11 JVM flags."
791798
fi
792799

793800
if [[ -n "${HBASE_TRACE_OPTS}" ]]; then

pom.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2851,7 +2851,16 @@
28512851
<properties>
28522852
<maven.compiler.release>${releaseTarget}</maven.compiler.release>
28532853
<!-- TODO: replicate logic for windows support -->
2854-
<argLine>--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED ${hbase-surefire.argLine}</argLine>
2854+
<argLine>-Dio.netty.tryReflectionSetAccessible=true
2855+
--illegal-access=permit
2856+
--add-modules jdk.unsupported
2857+
--add-opens java.base/java.nio=ALL-UNNAMED
2858+
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
2859+
--add-opens java.base/java.lang=ALL-UNNAMED
2860+
--add-opens java.base/jdk.internal.ref=ALL-UNNAMED
2861+
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
2862+
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED
2863+
${hbase-surefire.argLine}</argLine>
28552864
<!-- We need a minimum HDFS version of 3.2.0 for HADOOP-12760 -->
28562865
<hadoop-three.version>3.2.0</hadoop-three.version>
28572866
<!--

0 commit comments

Comments
 (0)