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

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-daemon.git


The following commit(s) were added to refs/heads/master by this push:
     new 1f5284f  [DAEMON-471] Add support for --enable-native-access Java 
startup option in jsvc
1f5284f is described below

commit 1f5284ffaa4831bd836cbf12af91e6d2652a7669
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Fri May 2 23:39:20 2025 +0200

    [DAEMON-471] Add support for --enable-native-access Java startup option in 
jsvc
    
    This closes #257
---
 src/changes/changes.xml            | 3 +++
 src/native/unix/native/arguments.c | 4 ++++
 src/native/unix/native/help.c      | 2 ++
 src/site/xdoc/jsvc.xml             | 2 ++
 4 files changed, 11 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 98813fa..29ec73c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -44,6 +44,9 @@
       <!-- FIX -->
       <action type="fix" dev="ggregory" due-to="Gary Gregory">Remove -nouses 
directive from maven-bundle-plugin. OSGi package imports now state 'uses' 
definitions for package imports, this doesn't affect JPMS (from 
org.apache.commons:commons-parent:80).</action>
       <!-- ADD -->
+      <action issue="DAEMON-471" dev="michaelo" type="add">
+        Add support for --enable-native-access Java startup option in jsvc
+      </action>
       <!-- UPDATE -->
       <action dev="ggregory" type="update" due-to="Gary Gregory, 
Dependabot">Bump org.apache.commons:commons-parent from 78 to 83 #253, 
#255.</action>
     </release>
diff --git a/src/native/unix/native/arguments.c 
b/src/native/unix/native/arguments.c
index 267483f..458e802 100644
--- a/src/native/unix/native/arguments.c
+++ b/src/native/unix/native/arguments.c
@@ -426,6 +426,10 @@ static arg_data *parse(int argc, char *argv[])
         else if (!strncmp(argv[x], "--enable-preview", 16)) {
             args->opts[args->onum++] = strdup(argv[x]);
         }
+        /* Java 21 specific options */
+        else if (!strncmp(argv[x], "--enable-native-access=", 23)) {
+            args->opts[args->onum++] = strdup(argv[x]);
+        }
         else if (*argv[x] == '-') {
             log_error("Invalid option %s", argv[x]);
             return NULL;
diff --git a/src/native/unix/native/help.c b/src/native/unix/native/help.c
index e0ce6ba..f7d9ab6 100644
--- a/src/native/unix/native/help.c
+++ b/src/native/unix/native/help.c
@@ -123,6 +123,8 @@ void help(home_data *data)
     printf("        Refer java help for possible values.\n");
     printf("    --enable-preview\n");
     printf("        Java 11 --enable-preview option. Passed as it is to 
JVM\n");
+    printf("    --enable-native-access=<module name>\n");
+    printf("        Java 21 --enable-native-access option. Passed as it is to 
JVM\n");
     printf("\njsvc (Apache Commons Daemon) " JSVC_VERSION_STRING "\n");
     printf("Copyright (c) 1999-2025 Apache Software Foundation.\n");
 
diff --git a/src/site/xdoc/jsvc.xml b/src/site/xdoc/jsvc.xml
index 57e33a9..64ffdf9 100644
--- a/src/site/xdoc/jsvc.xml
+++ b/src/site/xdoc/jsvc.xml
@@ -207,6 +207,8 @@ Where options include:
         Java 9 --patch-module option. Passed as it is to JVM
     --illegal-access=&lt;value&gt;
         Java 9 --illegal-access option. Passed as it is to JVM. Refer java 
help for possible values.
+    --enable-native-access=&lt;module name&gt;
+        Java 21 --enable-native-access option. Passed as it is to JVM
 </source>
 </p>
 <subsection name="Mac OS X universal binaries">

Reply via email to