Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javadoc not generated with jdk 1.9 but getting generated with jdk 1.8

I am using same command to generate javadoc with jdk 1.8 and 1.9 while doc gets generated with errors and warning in jdk 1.8 but is not getting generated with 1.9.

Below is the command I am using:-

C:\Program Files\Java\jdk1.8.0_05\bin>javadoc -d D:\APIdoc -sourcepath D:\MyFile\src\main\java -subpackages com.abc.dap.pqr
Output:
100 errors 
100 warnings
Doc generated successfully

C:\Program Files\Java\jdk-9\bin>javadoc -d D:\APIdoc1 -sourcepath D:\MyFile\src\main\java -subpackages com.abc.dap.pqr
Output:
100 errors
Doc not generated

Below are the errors:-
error: package [package_name] does not exist
error: cannot find symbol

Same errors are observed in jdk1.8 and 1.9 but I am unable to understand why doc is not generated with 1.9. Please suggest workaround for generating javadoc with jdk1.9

like image 361
Snehal Gupta Avatar asked Jan 26 '26 22:01

Snehal Gupta


2 Answers

It is a deliberate change in JDK 9 to treat the errors as unrecoverable and exit without generating the javadoc. This is documented in the JDK 9 release notes (http://jdk.java.net/9/release-notes#JDK-8175219).

As noted in the comments then the using the old doclet (with -Xold) might work for this case but it doesn't support module information. Also the old doclet will be removed in the next release.

like image 88
Alan Bateman Avatar answered Jan 29 '26 03:01

Alan Bateman


You may have better luck by turning off some of the checks using -Xdoclint:-<group>, particularly -Xdoclint:-reference which will cause it to ignore issues relating to the references to Java API elements from Javadoc tags, or even -Xdoclint:none to turn off all checks. If that doesn't help, you can invoke the legacy javadoc tool with -Xold.

See javadoc -X or the javadoc documentation for more information.

like image 35
David Conrad Avatar answered Jan 29 '26 04:01

David Conrad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!