You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "VVD (Jira)" <ji...@apache.org> on 2025/05/02 20:48:00 UTC

[jira] [Comment Edited] (DAEMON-471) Add support for --enable-native-access java startup option in jsvc

    [ https://issues.apache.org/jira/browse/DAEMON-471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17949020#comment-17949020 ] 

VVD edited comment on DAEMON-471 at 5/2/25 8:47 PM:
----------------------------------------------------

Tomcat 11 itself adds this option at startup in bin/catalina.sh:
{code:bash}
#Add the module start-up parameters required by Tomcat
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang.reflect=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.io=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.util=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --enable-native-access=ALL-UNNAMED"
{code}
But if you run tomcat via jsvc, then the only way I found is via the environment variable JAVA_TOOL_OPTIONS.


was (Author: vvd):
Tomcat 11 itself adds this option at startup:
{code:bash}
#Add the module start-up parameters required by Tomcat
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.lang.reflect=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.io=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.util=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
JAVA_OPTS="$JAVA_OPTS --enable-native-access=ALL-UNNAMED"
{code}
But if you run tomcat via jsvc, then the only way I found is via the environment variable JAVA_TOOL_OPTIONS.

> Add support for --enable-native-access java startup option in jsvc
> ------------------------------------------------------------------
>
>                 Key: DAEMON-471
>                 URL: https://issues.apache.org/jira/browse/DAEMON-471
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>    Affects Versions: 1.4.1
>            Reporter: VVD
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)