Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Stanimir Stamenkov Newsgroups: comp.lang.java.programmer Subject: Re: Java 11: Inherit javadoc from base java classes Date: Sun, 3 Oct 2021 09:41:35 +0300 Organization: A noiseless patient Spider Lines: 105 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 3 Oct 2021 06:41:36 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="aa5c69e30959767c53f4109e4c2c2e75"; logging-data="25987"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/J3es0kKaUV4EeCAu/dgRt" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 SeaMonkey/2.53.9.1 Cancel-Lock: sha1:Pm1cyJ1KKboFYXmqUCYegqgWxHs= In-Reply-To: X-Face: (5^k'[FumQ)D/*_,+2"Ax+MLyw-[=}5`U9T`X4>1ky(A:/OBmW0 N~qm3*Yo0^iugH;XTH;'lGWv}@;U!P\.:7v;~BU;XmX wB`d4DX><96aT}f6v}i7oU}bzwjzX`q.yUbgV:+=Zt On 10/2/2021 3:18 PM, Stanimir Stamenkov wrote: > >> I'm trying to generate javadoc for the given source while inheriting >> apidoc from the base class/interface which happens to be from the >> standard Java library. >> >> I have the following "options" file (I'm on Windows for what is worth): >> >> net.example >> -d >> doc >> -sourcepath >> src;C:\java\jdk-11\src >> -link >> https://docs.oracle.com/en/java/javase/11/docs/api >> >> I have extracted the "src.zip" in the "C:\java\jdk-11" installation to >> a "src" subdirectory just for that purpose. >> >> I'm executing: >> >>  > javadoc @options >> >> but I'm not getting the generated javadoc inheriting apidoc from the >> jdk sources. >> >> The same example using Java 8 javadoc, and options: >> >> net.example >> -d >> doc >> -sourcepath >> src;C:\java\jdk1.8.0\src >> -link >> https://docs.oracle.com/javase/8/docs/api >> >> works as expected.  What configuration I need to use to make the same >> working with Java 11's javadoc? > > I suspect that you may need to add the module name to the source > path for Java 11: > > -sourcepath > src;C:\java\jdk-11\src\java.desktop Thanks for chiming in. With this setup I'm getting mixed results: >javadoc @options Loading source files for package net.example... Constructing Javadoc information... Creating destination directory: "doc\" Standard Doclet version 11.0.12 Building tree for all the packages and classes... Generating doc\java.desktop\net\example\FooOp.html... Generating doc\java.desktop\net\example\package-summary.html... Generating doc\java.desktop\net\example\package-tree.html... Generating doc\java.desktop\module-summary.html... C:\java\jdk-11\src\java.desktop\module-info.java:48: error: unknown tag: moduleGraph * @moduleGraph ^ Generating doc\constant-values.html... Building index for all the packages and classes... Generating doc\overview-tree.html... Generating doc\index-all.html... Building index for all classes... Generating doc\allclasses-index.html... Generating doc\allpackages-index.html... Generating doc\deprecated-list.html... Building index for all classes... Generating doc\allclasses.html... Generating doc\allclasses.html... Generating doc\index.html... Generating doc\help-doc.html... 1 error I'm getting the javadoc inherited but my package gets included in the "java.desktop" module. I've tried next: >javac -d classes src\net\example\FooOp.java and adding to the javadoc options: -classpath classes >javadoc @options Loading source files for package net.example... Constructing Javadoc information... Note: Multiple elements named 'net.example' in modules 'java.desktop, unnamed module' were found by javax.lang.model.util.Elements.getPackageElement. javadoc: warning - Package net.example not found javadoc: error - No public or protected classes found to document. 1 error 1 warning (no doc generated at all) I'll further try adding a module descriptor for my source, though my goal is dealing with unnamed module sources. -- Stanimir