From aad61877c490a47ed9fe0147816db138b94563fc Mon Sep 17 00:00:00 2001 From: Sakthi Date: Fri, 5 Apr 2019 15:20:16 -0700 Subject: [PATCH] HBASE-22172: Suppress Java 11 reflective access warnings --- bin/hbase-config.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bin/hbase-config.sh b/bin/hbase-config.sh index 1054751e633e4b7915e52aa4d1bc7f1f7f773cc2..76b354fb7a0033f8c625f5fe6a02048adbfab377 100644 --- a/bin/hbase-config.sh +++ b/bin/hbase-config.sh @@ -168,3 +168,24 @@ if [ -z "$JAVA_HOME" ]; then EOF exit 1 fi + +JAVA=$JAVA_HOME/bin/java +version=$(JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}') +if [[ "$version" > "11" ]]; then + # Uncomment the following line to enable warnings of further illegal reflective access operations + # HBASE_OPTS="$HBASE_OPTS --illegal-access=warn" + + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.nio=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.security.jgss/sun.security.krb5=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/sun.nio.ch=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/sun.nio.cs=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.lang=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.lang.reflect=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.util.regex=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.util.zip=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.util=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.net=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.io=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/java.security=ALL-UNNAMED" + HBASE_OPTS="$HBASE_OPTS --add-opens java.base/javax.crypto=ALL-UNNAMED" +fi -- 2.17.2 (Apple Git-113)