Skip to content

Commit 82e47cd

Browse files
authored
HBASE-25058 Export necessary modules when running under JDK11 (apache#4337)
Singed-off-by: Nick Dimiduk <ndimiduk@apache.org>
1 parent 13d932c commit 82e47cd

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
@@ -492,6 +492,10 @@ add_jdk11_deps_to_classpath() {
492492
done
493493
}
494494

495+
add_jdk11_jvm_flags() {
496+
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"
497+
}
498+
495499
add_opentelemetry_agent() {
496500
if [ -e "${OPENTELEMETRY_JAVAAGENT_PATH}" ] ; then
497501
agent_jar="${OPENTELEMETRY_JAVAAGENT_PATH}"
@@ -811,11 +815,14 @@ fi
811815

812816
if [ "${addJDK11Jars}" = "true" ]; then
813817
add_jdk11_deps_to_classpath
818+
add_jdk11_jvm_flags
814819
if [ "${DEBUG}" = "true" ]; then
815-
echo "Added JDK11 jars to classpath."
816-
fi
820+
echo "Added JDK11 jars to classpath."
821+
echo "Added JDK11 JVM flags too."
822+
fi
817823
elif [ "${DEBUG}" = "true" ]; then
818824
echo "JDK11 jars skipped from classpath."
825+
echo "Skipped adding JDK11 JVM flags."
819826
fi
820827

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

pom.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3048,7 +3048,16 @@
30483048
<properties>
30493049
<maven.compiler.release>${releaseTarget}</maven.compiler.release>
30503050
<!-- TODO: replicate logic for windows support -->
3051-
<argLine>--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED ${hbase-surefire.argLine}</argLine>
3051+
<argLine>-Dio.netty.tryReflectionSetAccessible=true
3052+
--illegal-access=permit
3053+
--add-modules jdk.unsupported
3054+
--add-opens java.base/java.nio=ALL-UNNAMED
3055+
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
3056+
--add-opens java.base/java.lang=ALL-UNNAMED
3057+
--add-opens java.base/jdk.internal.ref=ALL-UNNAMED
3058+
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
3059+
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED
3060+
${hbase-surefire.argLine}</argLine>
30523061
<!-- We need a minimum HDFS version of 3.2.0 for HADOOP-12760 -->
30533062
<hadoop-three.version>3.2.0</hadoop-three.version>
30543063
<!--

0 commit comments

Comments
 (0)