Skip to content

Commit

Permalink
HBASE-25058 Export necessary modules when running under JDK11
Browse files Browse the repository at this point in the history
  • Loading branch information
Apache9 committed Apr 13, 2022
1 parent ea9bc92 commit 2cb0ed0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions bin/hbase
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3030,7 +3030,7 @@
<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>--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}</argLine>
<!-- We need a minimum HDFS version of 3.2.0 for HADOOP-12760 -->
<hadoop-three.version>3.2.0</hadoop-three.version>
<!--
Expand Down

0 comments on commit 2cb0ed0

Please sign in to comment.