Change in behavior of javax.tools.JavaCompiler in JDK 8 running with -proc:only ?

Boaz Nahum boaznahum at gmail.com
Tue Mar 11 15:27:44 UTC 2014


Hi

I hope some can give me hint how anlyse our probelms with JDK 8.

We use some code like this to do annotation processing (for generating
code):

            JavaCompiler.CompilationTask task =
                javaCompiler.getTask(null, fileManager, diagnostics,
optionsAsList, null, compilationUnits);

            BuildingBlockParamProcessor processor = new
BuildingBlockParamProcessor();
            List<Processor> processors = new ArrayList<Processor>();
            processors.add(processor);
            task.setProcessors(processors);
if(!task.call()){ .... }

The code we try to process won't be compile in regular environment - a lot
of stuff is missing from classpath.
But that is OK, we use '-proc:only' and we *thought* that this what allows
us to ignore the errors.


When we moved to JDK 8, the exact code fails,
javax.tools.JavaCompiler.CompilationTask#call returns false.


*My question, is a possibilty that '-proc:only' is ignored in JDK 8 ?*

*Or maybe there is by-design change regarding annotation processing that we
need to be aware of ?*
I want to mention that if the early EAP of JDK 8 , this code run without
any problems.

(Moving to annotation processing during compilation is big effort for us)

Any tip/hint will be appreciatively accepted

Thanks
Boaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20140311/23cbe978/attachment.html>


More information about the compiler-dev mailing list