-Xdoclint unrecognized in JDK16 due to new module
Alan Bateman
Alan.Bateman at oracle.com
Tue Dec 15 08:26:47 UTC 2020
On 14/12/2020 20:05, Benjamin Marwell wrote:
> 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:
> -Xdoclint:-missing.
>
> 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.
I think the Plexus Classworlds launcher sets a funky TCCL that impacts
the ServiceLoader lookup of DocLint providers. Can the ServiceLoader
usage in DocLint be changed to use the system class loader rather than
the TCCL to see if that "fixes it"?
-Alan.
More information about the jigsaw-dev
mailing list