-Xdoclint unrecognized in JDK16 due to new module

Benjamin Marwell bmarwell at apache.org
Mon Dec 14 20:05:11 UTC 2020

Hello all,

it caught my attention that doclint functionality was moved to the
jdk.javadoc module [1].

Now, when calling ToolProvider.getSystemJavaCompiler().getTask(…), the
presence of the option '-Xdoclint:-missing' and similar options will throw
this exception [2]:
   java.lang.IllegalArgumentException: error: invalid flag:

This call is being used in Apache Maven, and the Apache Zookeper project
already suffers from this issue and reported it upstream [3].

Adding the modules to the maven script 'mvn' did not help. But when calling
javac as an external tool (i.e. not via ToolProvider in the same process),
the options are being recognized.

I wonder how the doclint options can be made available to
the ToolProvider.getSystemJavaCompiler().getTask(…) call again.
Maven itself (and in this case: the compiler plugin) is, as you know, a
non-modular project.

Best regards,

[1] https://bugs.openjdk.java.net/browse/JDK-8252712
[3] https://bugs.openjdk.java.net/browse/JDK-8253996

More information about the jigsaw-dev mailing list