Annotation processors and the --processor-module-path

Alan Bateman Alan.Bateman at oracle.com
Tue Nov 22 13:57:31 UTC 2016


On 22/11/2016 10:33, Eirik Bjørsnøs wrote:

> :
>
> So again, I added -J-add-modules=java.xml.bind, and now my annotation
> processor is loading.
>
> Given that my annotation processor does require java.xml.bind and I'm using
> --processor-module-path, my expectation would be that javac would resolve
> that requires for me.
>
> What gives, am I expecting too much?
When you deploy annotation processors on the --processor-module-path 
then javac needs to resolve the annotation processor modules as part of 
creating the dynamic configuration. The issue with the dependency on 
java.xml.bind is that it's not in the boot layer and it's also not 
observable on the processor module path. There is no support at this 
time for augmenting the boot layer once it is created, also javac does 
not attempt to resolve these modules from the original module path and 
system image that were used to start the VM. So for now at least, 
running with -J--add-modules=java.xml.bind is the only way to get this 
to work.

-Alan


More information about the jigsaw-dev mailing list