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

Tomoko Uchida commented on LUCENE-10339:
----------------------------------------

True - "jdk.management" and "java.management" are on the module layer at the VM 
startup, and "jdk.unsupported" is not (unless it is required in the module 
descriptor).
{code:java}
  public static void main(String[] args) {
    try {
      var modules = Main.class.getModule().getLayer().modules();
      for (Module module : modules) {
          System.out.println(module.getName());
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
{code}
{code:java}
modtest $ java --version
openjdk 11.0.10 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)
modtest $ java --module-path build/libs -m modtest/modtest.Main | grep -v 
"modtest" | sort
java.base
java.compiler
java.datatransfer
java.desktop
java.logging
java.management
java.management.rmi
java.naming
java.prefs
java.rmi
java.security.jgss
java.security.sasl
java.smartcardio
java.xml
java.xml.crypto
jdk.charsets
jdk.compiler
jdk.crypto.cryptoki
jdk.crypto.ec
jdk.internal.opt
jdk.jartool
jdk.javadoc
jdk.jdeps
jdk.jfr
jdk.jlink
jdk.localedata
jdk.management
jdk.management.jfr
jdk.naming.dns
jdk.naming.rmi
jdk.security.auth
jdk.security.jgss
jdk.unsupported.desktop
jdk.zipfs
{code}
There are "java.base" + 33 other modules at runtime whether the application 
explicitly requires or not; AdoptOpenJDK 11, OpenJDK 11, Coretto 11 returns the 
same result for me. (I didn't expect "java.desktop" to be loaded.) 
In jdk 17, there is no removed module since jdk 11 while "jdk.jpackage" and 
"jdk.random" have been added.

 

> Add require derective for jdk.management to core's module descriptor.
> ---------------------------------------------------------------------
>
>                 Key: LUCENE-10339
>                 URL: https://issues.apache.org/jira/browse/LUCENE-10339
>             Project: Lucene - Core
>          Issue Type: Sub-task
>            Reporter: Tomoko Uchida
>            Priority: Major
>         Attachments: Screenshot from 2021-12-25 18-04-55.png, Screenshot from 
> 2021-12-25 20-11-38.png
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> IntelliJ IDEA warns as follows in o.a.l.u.RamUsageEstimator.
>  !Screenshot from 2021-12-25 18-04-55.png! 
>  !Screenshot from 2021-12-25 20-11-38.png! 
> This means we would need "require" or "require static" directive(s) in core's 
> module descriptor to make RamUsageEstimator correctly work.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to