This is an automated email from the ASF dual-hosted git repository.

dpitkin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new e2d4dbfa43 GH-43412: [Java][Benchmarking] Use JDK_JAVA_OPTIONS for JVM 
arguments (#43411)
e2d4dbfa43 is described below

commit e2d4dbfa43ea570c1d3234776f4ea44170f1792f
Author: Dane Pitkin <[email protected]>
AuthorDate: Thu Jul 25 09:14:50 2024 -0400

    GH-43412: [Java][Benchmarking] Use JDK_JAVA_OPTIONS for JVM arguments 
(#43411)
    
    ### Rationale for this change
    
    Java options are not getting picked up properly in archery.
    
    ### What changes are included in this PR?
    
    * Use JDK_JAVA_OPTIONS instead of _JAVA_OPTIONS env var.
    
    ### Are these changes tested?
    
    Test via benchmark bot (ursabot)
    
    ### Are there any user-facing changes?
    
    No
    * GitHub Issue: #43412
    
    Authored-by: Dane Pitkin <[email protected]>
    Signed-off-by: Dane Pitkin <[email protected]>
---
 dev/archery/archery/lang/java.py | 2 +-
 docs/source/java/install.rst     | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dev/archery/archery/lang/java.py b/dev/archery/archery/lang/java.py
index 0087208d34..f447b352e6 100644
--- a/dev/archery/archery/lang/java.py
+++ b/dev/archery/archery/lang/java.py
@@ -73,7 +73,7 @@ class JavaConfiguration:
             env["JAVA_HOME"] = self.java_home
 
         if self.java_options:
-            env["JAVA_OPTIONS"] = self.java_options
+            env["JDK_JAVA_OPTIONS"] = self.java_options
 
         return env
 
diff --git a/docs/source/java/install.rst b/docs/source/java/install.rst
index 3e01f72a56..c238690c6b 100644
--- a/docs/source/java/install.rst
+++ b/docs/source/java/install.rst
@@ -40,7 +40,7 @@ adding 
``--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED
    # Directly on the command line
    $ 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=org.apache.arrow.memory.core,ALL-UNNAMED"
 java -jar ...
+   $ env 
JDK_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`` or ``module java.base does not "opens
@@ -58,7 +58,7 @@ Modifying the command above for Flight:
    # Directly on the command line
    $ java 
--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED -jar ...
    # Indirectly via environment variables
-   $ env _JAVA_OPTIONS="--add-reads=org.apache.arrow.flight.core=ALL-UNNAMED 
--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED" java 
-jar ...
+   $ env 
JDK_JAVA_OPTIONS="--add-reads=org.apache.arrow.flight.core=ALL-UNNAMED 
--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED" java 
-jar ...
 
 Otherwise, you may see errors like ``java.lang.IllegalAccessError: superclass 
access check failed: class
 org.apache.arrow.flight.ArrowMessage$ArrowBufRetainingCompositeByteBuf (in 
module org.apache.arrow.flight.core)
@@ -73,7 +73,7 @@ Modifying the command above for arrow-memory:
    # Directly on the command line
    $ 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=org.apache.arrow.dataset,org.apache.arrow.memory.core,ALL-UNNAMED"
 java -jar ...
+   $ env 
JDK_JAVA_OPTIONS="--add-opens=java.base/java.nio=org.apache.arrow.dataset,org.apache.arrow.memory.core,ALL-UNNAMED"
 java -jar ...
 
 Otherwise you may see errors such as ``java.lang.RuntimeException: 
java.lang.reflect.InaccessibleObjectException:
 Unable to make static void java.nio.Bits.reserveMemory(long,long) accessible: 
module
@@ -216,7 +216,7 @@ Or they can be added via environment variable, for example 
when executing your c
 
 .. code-block::
 
-    _JAVA_OPTIONS="--add-opens=java.base/java.nio=ALL-UNNAMED" mvn exec:java 
-Dexec.mainClass="YourMainCode"
+    JDK_JAVA_OPTIONS="--add-opens=java.base/java.nio=ALL-UNNAMED" mvn 
exec:java -Dexec.mainClass="YourMainCode"
 
 Installing from Source
 ======================

Reply via email to