javadoc fails to find a module if import statements are present in module-info.java

xen at mail.de xen at mail.de
Mon Sep 18 12:42:33 UTC 2023


Dear javadoc devs,   first please excuse that I am asking (maybe) a usage question on this list, but I wasn't able to find an answer online, including a stack overflow question pending at https://stackoverflow.com/questions/77098070/javadoc-fails-in-presence-of-imports-in-module-info-java. The issue: Sometimes I generate my "own" javadoc of the standard library to supply my favorite settings to the javadoc tool. Thereby I encounter strange module-not-found errors for modules where import statements are present in the module-info.java file. Minimal example, e.g. for java.management, using JDK 20:   .../jdk-20.0.2/bin/javadoc -sourcepath .../jdk-jdk-20-ga/src/java.management/share/classes -subpackages com:java:javax:sun --module java.management -verbose   results in:    

[parsing started SimpleFileObject[.../jdk-jdk-20-ga/src/java.management/share/classes/module-info.java]] [parsing completed 22ms] error: module java.management not found on source path 1 error    If I remove the import statement in java.management/share/classes/module-info.java the command works as expected. I tried adding the module hosting the imported package (jdk.compiler) to the sourcepath or module path in various ways (also consulting https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html and the corresponding page for javac) but was not able to solve this issue (I work around it by out-commenting the import statements). If this is considered off-topic as a usage question, please point me to a better location to ask the question, or (if you don't mind) I would be glad about a proper command line snippet that does the trick. However, even if this is just a usage issue I would recommend to improve the error message. At very least it should point out that an imported package was not found, rather than the module as a whole and without further information.   Kind regards   Stefan   

-------------------------------------------------------------------------------------------------
FreeMail powered by mail.de - MEHR SICHERHEIT, SERIOSITÄT UND KOMFORT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/javadoc-dev/attachments/20230918/01b34f83/attachment.htm>


More information about the javadoc-dev mailing list