You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "renatsaf (via GitHub)" <gi...@apache.org> on 2026/06/16 21:58:05 UTC

Re: [I] Can't run Java enterprise application client against glassfish 7.0.6 server because VM won't create because of -Djava.endorsed.dirs [netbeans]

renatsaf commented on issue #6270:
URL: https://github.com/apache/netbeans/issues/6270#issuecomment-4723987928

   Root cause and a fix in #9446.
   
   The `-Djava.endorsed.dirs=…` argument is not generated by the project's `build-impl.xml` (its own `endorsed.classpath.cmd.line.arg` correctly uses `-Xbootclasspath/p:` and is empty here). It comes from the GlassFish plugin: `Hk2JavaEEPlatformImpl.getToolProperty(TOOL_APP_CLIENT_RUNTIME, TOOL_PROP_JVM_OPTS)` unconditionally prepends `-Djava.endorsed.dirs=<root>/lib/endorsed:<root>/modules/endorsed` to the app-client container JVM options. That flows into the generated build script as `j2ee.appclient.tool.jvmoptions` and is passed as a `<jvmarg>` to the `run-appclient` macro.
   
   The endorsed-standards mechanism was removed in JDK 9 (JEP 220), and HotSpot deliberately aborts at startup when `java.endorsed.dirs` is set — which is why the client JVM never starts. GlassFish 7 requires JDK 11+ and ships no `endorsed` directories, so the option is both invalid and points at non-existent paths (matching your observation that the directory doesn't exist).
   
   #9446 builds the option only from the `lib/endorsed` / `modules/endorsed` directories that actually exist and omits it entirely when neither is present, so app clients run on JDK 9+ while legacy JDK 8 servers that still ship those dirs are unaffected.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists