From 703f9ef0be268b06ef18a76a00930cb30e65c595 Mon Sep 17 00:00:00 2001 From: James Duong Date: Fri, 5 Jan 2024 13:49:17 -0800 Subject: [PATCH] Update docs and archery tester for arrow-memory modules 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 --- dev/archery/archery/integration/tester_java.py | 5 +++-- docs/source/java/install.rst | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dev/archery/archery/integration/tester_java.py b/dev/archery/archery/integration/tester_java.py index 6cd1afa64feb8..032ac13e74ec2 100644 --- a/dev/archery/archery/integration/tester_java.py +++ b/dev/archery/archery/integration/tester_java.py @@ -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", ] @@ -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 = ( diff --git a/docs/source/java/install.rst b/docs/source/java/install.rst index 32c121573a692..b7484536f2367 100644 --- a/docs/source/java/install.rst +++ b/docs/source/java/install.rst @@ -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``.