You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "mbien (via GitHub)" <gi...@apache.org> on 2024/12/15 20:41:18 UTC
[PR] Log JDK boot modules on startup. [netbeans]
mbien opened a new pull request, #8059:
URL: https://github.com/apache/netbeans/pull/8059
could be useful while inspecting user logs (e.g https://github.com/apache/netbeans/issues/8026) since it would identify headless JDKs or JREs with non-standard module lists.
```
...
Java Boot Modules = [java.base, java.compiler, java.datatransfer, java.desktop, java.instrument, java.logging, java.management, java.management.rmi, java.naming, java.net.http, java.prefs, java.rmi, java.scripting, java.security.jgss, java.security.sasl, java.smartcardio, java.sql, java.sql.rowset, java.transaction.xa, java.xml, java.xml.crypto, jdk.accessibility, jdk.attach, jdk.charsets, jdk.compiler, jdk.crypto.cryptoki, jdk.dynalink, jdk.editpad, jdk.httpserver, jdk.internal.ed, jdk.internal.jvmstat, jdk.internal.le, jdk.internal.md, jdk.internal.opt, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdeps, jdk.jdi, jdk.jdwp.agent, jdk.jfr, jdk.jlink, jdk.jpackage, jdk.jshell, jdk.jsobject, jdk.jstatd, jdk.localedata, jdk.management, jdk.management.agent, jdk.management.jfr, jdk.naming.dns, jdk.naming.rmi, jdk.net, jdk.nio.mapmode, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, jdk.zipfs]
...
```
--
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
Re: [PR] Log JDK boot modules on startup. [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on code in PR #8059:
URL: https://github.com/apache/netbeans/pull/8059#discussion_r1887167886
##########
platform/core.startup/src/org/netbeans/core/startup/TopLogging.java:
##########
@@ -309,6 +313,32 @@ private static String createBootClassPath() {
return sb.toString();
}
+ private List<String> createJavaBootModuleList() {
+ // TODO JDK 11 equivalent
+// return ModuleLayer.boot().modules().stream()
+// .map(Module::getName)
+// .sorted()
+// .collect(Collectors.toList());
+ try {
+ Class<?> mod_class = Class.forName("java.lang.Module");
+ Class<?> ml_class = Class.forName("java.lang.ModuleLayer");
+ @SuppressWarnings("unchecked")
+ Set<?> mods = (Set<?>)ml_class.getDeclaredMethod("modules").invoke(
+ ml_class.getDeclaredMethod("boot").invoke(null)
+ );
+ return mods.stream().map(mod -> {
+ try {
+ return (String) mod_class.getMethod("getName").invoke(mod);
Review Comment:
oh you are right! will update
--
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
Re: [PR] Log JDK boot modules on startup. [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien merged PR #8059:
URL: https://github.com/apache/netbeans/pull/8059
--
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
Re: [PR] Log JDK boot modules on startup. [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on code in PR #8059:
URL: https://github.com/apache/netbeans/pull/8059#discussion_r1887153910
##########
platform/core.startup/src/org/netbeans/core/startup/TopLogging.java:
##########
@@ -309,6 +313,32 @@ private static String createBootClassPath() {
return sb.toString();
}
+ private List<String> createJavaBootModuleList() {
+ // TODO JDK 11 equivalent
+// return ModuleLayer.boot().modules().stream()
+// .map(Module::getName)
+// .sorted()
+// .collect(Collectors.toList());
+ try {
+ Class<?> mod_class = Class.forName("java.lang.Module");
+ Class<?> ml_class = Class.forName("java.lang.ModuleLayer");
+ @SuppressWarnings("unchecked")
+ Set<?> mods = (Set<?>)ml_class.getDeclaredMethod("modules").invoke(
+ ml_class.getDeclaredMethod("boot").invoke(null)
+ );
+ return mods.stream().map(mod -> {
+ try {
+ return (String) mod_class.getMethod("getName").invoke(mod);
Review Comment:
You could pull the method lookup out of the loop.
--
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
Re: [PR] Log JDK boot modules on startup. [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #8059:
URL: https://github.com/apache/netbeans/pull/8059#issuecomment-2546118724
Apart from the small suggestion, this makes sense to me.
--
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