Skip to content
Permalink
Browse files
HBASE-25058 Export necessary modules when running under JDK11 (#4337)
Singed-off-by: Nick Dimiduk <ndimiduk@apache.org>
  • Loading branch information
Apache9 committed Apr 21, 2022
1 parent 13d932c commit 82e47cde27c1db91a685cff38c44a5572194f988
Showing 2 changed files with 19 additions and 3 deletions.
@@ -492,6 +492,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}"
@@ -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
11 pom.xml
@@ -3048,7 +3048,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>
<!--

0 comments on commit 82e47cd

Please sign in to comment.