Skip to content

Commit

Permalink
Update docs and archery tester for arrow-memory modules
Browse files Browse the repository at this point in the history
Update the command-line in the docs and the archery java tester
to allow exposing reflection on unsafe on the org.apache.arrow.memory.core
module
  • Loading branch information
jduo committed Jan 5, 2024
1 parent caef2f1 commit 703f9ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dev/archery/archery/integration/tester_java.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def load_version_from_pom():
_JAVA_OPTS = [
"-Dio.netty.tryReflectionSetAccessible=true",
"-Darrow.struct.conflict.policy=CONFLICT_APPEND",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED",
# GH-39113: avoid failures accessing files in `/tmp/hsperfdata_...`
"-XX:-UsePerfData",
]
Expand Down Expand Up @@ -247,7 +247,8 @@ def __init__(self, *args, **kwargs):
if 'Unrecognized option: --add-opens' not in proc.stderr:
# Java 9+
self._java_opts.append(
'--add-opens=java.base/java.nio=ALL-UNNAMED')
'--add-opens=java.base/java.nio='
'org.apache.arrow.memory.core,ALL-UNNAMED')

def _run(self, arrow_path=None, json_path=None, command='VALIDATE'):
cmd = (
Expand Down
6 changes: 3 additions & 3 deletions docs/source/java/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ Java modules are compatible with JDK 8 and above.
Currently, JDK 8, 11, 17, and 21 are tested in CI.

When using Java 9 or later, some JDK internals must be exposed by
adding ``--add-opens=java.base/java.nio=ALL-UNNAMED`` to the ``java`` command:
adding ``--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED`` to the ``java`` command:

.. code-block:: shell
# Directly on the command line
$ java --add-opens=java.base/java.nio=ALL-UNNAMED -jar ...
$ java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED -jar ...
# Indirectly via environment variables
$ env _JAVA_OPTIONS="--add-opens=java.base/java.nio=ALL-UNNAMED" java -jar ...
$ env _JAVA_OPTIONS="--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED" java -jar ...
Otherwise, you may see errors like ``module java.base does not "opens
java.nio" to unnamed module``.
Expand Down

0 comments on commit 703f9ef

Please sign in to comment.