Sat, 2 Oct 2021 20:22:04 -0400, /Arne Vajhøj/:
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
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)