javanullpointerexceptionjava-7eclipse-jdt

Eclipse JDT Compiler (ECJ) throws NPE in Java 1.7


I'm getting an NPE from the ECJ (version 4.2.1) compiler when running in JRE 1.7 the same project compiles properly on JRE 1.6.

A CompilationProgress monitor shows that there are Total of 2493 tasks, but then I get the NPE.

Any ideas?

TIA

java.lang.NullPointerException
    at org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.concatFiles(EclipseFileManager.java:202)
    at org.eclipse.jdt.internal.compiler.apt.util.EclipseFileManager.handleOption(EclipseFileManager.java:669)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BatchProcessingEnvImpl.(BatchProcessingEnvImpl.java:88)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BatchAnnotationProcessorManager.configure(BatchAnnotationProcessorManager.java:69)
    at org.eclipse.jdt.internal.compiler.batch.Main.initializeAnnotationProcessorManager(Main.java:3632)
    at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:3737)
    at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1679)
    at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1372)
    at org.eclipse.jdt.core.compiler.batch.BatchCompiler.compile(BatchCompiler.java:80)
    at org.eclipse.jdt.core.compiler.batch.BatchCompiler.compile(BatchCompiler.java:52)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
...
    at java.lang.Thread.run(Thread.java:722)

Solution

  • Turns out to be an Eclipse JDT bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=405225

    Hopefully it will be fixed in the next version.