Skip to content

Commit

Permalink
DRILL-8498: Sqlline illegal reflective access warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rymarm committed Jun 12, 2024
1 parent a9e84a1 commit 40500ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions distribution/src/main/resources/drill-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,22 @@ export DRILLBIT_OPTS="$DRILLBIT_OPTS -XX:ReservedCodeCacheSize=$DRILLBIT_CODE_CA
# This option prevents the PDF Format Plugin from opening unnecessary Java windows
export DRILLBIT_OPTS="$DRILLBIT_OPTS -Djava.awt.headless=true"

REF_ACC_OPTS=""
# Check that java is newer than 1.8
"$JAVA" -version 2>&1 | grep "version" | egrep -e "1\.8" > /dev/null
if [ $? -gt 0 ]; then
# Allow reflective access on Java 9+
export DRILLBIT_OPTS="$DRILLBIT_OPTS --add-opens java.base/java.lang=ALL-UNNAMED"
export DRILLBIT_OPTS="$DRILLBIT_OPTS --add-opens=java.base/java.util=ALL-UNNAMED"
export DRILLBIT_OPTS="$DRILLBIT_OPTS --add-opens java.base/sun.nio.ch=ALL-UNNAMED"
export DRILLBIT_OPTS="$DRILLBIT_OPTS --add-opens java.base/java.net=ALL-UNNAMED"
export DRILLBIT_OPTS="$DRILLBIT_OPTS --add-opens java.base/java.nio=ALL-UNNAMED"
export DRILLBIT_OPTS="$DRILLBIT_OPTS --add-opens java.security.jgss/sun.security.krb5=ALL-UNNAMED"
REF_ACC_OPTS="$REF_ACC_OPTS --add-opens java.base/java.lang=ALL-UNNAMED"
REF_ACC_OPTS="$REF_ACC_OPTS --add-opens=java.base/java.util=ALL-UNNAMED"
REF_ACC_OPTS="$REF_ACC_OPTS --add-opens java.base/sun.nio.ch=ALL-UNNAMED"
REF_ACC_OPTS="$REF_ACC_OPTS --add-opens java.base/java.net=ALL-UNNAMED"
REF_ACC_OPTS="$REF_ACC_OPTS --add-opens java.base/java.nio=ALL-UNNAMED"
REF_ACC_OPTS="$REF_ACC_OPTS --add-opens java.security.jgss/sun.security.krb5=ALL-UNNAMED"
export REF_ACC_OPTS

export DRILLBIT_OPTS="$DRILLBIT_OPTS $REF_ACC_OPTS"
fi


# Under YARN, the log directory is usually YARN-provided. Replace any
# value that may have been set in drill-env.sh.

Expand Down
2 changes: 1 addition & 1 deletion distribution/src/main/resources/sqlline
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ if ! $is_cygwin; then
DRILL_SHELL_OPTS="$DRILL_SHELL_OPTS --color=true"
fi

SHELL_OPTS="$DRILL_SHELL_JAVA_OPTS $SQLLINE_JAVA_OPTS $DRILL_SHELL_LOG_OPTS $CLIENT_GC_OPTS -Dorg.jline.terminal.dumb=true"
SHELL_OPTS="$DRILL_SHELL_JAVA_OPTS $SQLLINE_JAVA_OPTS $REF_ACC_OPTS $DRILL_SHELL_LOG_OPTS $CLIENT_GC_OPTS -Dorg.jline.terminal.dumb=true"
CMD="$JAVA $SHELL_OPTS -cp $CP sqlline.SqlLine -ac org.apache.drill.exec.client.DrillSqlLineApplication"

# The wrapper is purely for unit testing.
Expand Down

0 comments on commit 40500ec

Please sign in to comment.