I'm trying to get NonNull annotations working in NetBeans, and it's been one headache after another.
I followed the instructions at https://checkerframework.org/manual/#netbeans and can confirm that checker-qual.jar
is added as both a compile and processor library. I've enabled annotation processing and added org.checkerframework.checker.nullness.NullnessChecker
as an Annotation Processor.
In the source code I can import import org.checkerframework.checker.nullness.qual.NonNull
and have @NonNull
annotations compile. However while building I get this:
error: Annotation processor 'org.checkerframework.checker.nullness.NullnessChecker' not found
What do I need to do to resolve this error?
The instructions for the NetBeans processor path are incorrect: they first talk about adding
checker.jar
, but then mentionchecker-qual.jar
https://github.com/typetools/checker-framework/blob/master/docs/manual/external-tools.tex#L904checker.jar
contains the actual annotation processor and should be put on the processor path. I'll update the instructions.However, we did not yet find a way to add the annotated JDK
jdk8.jar
to the bootclasspath that the processor uses. Therefore, none of the JDK annotations that are provided will be visible within NetBeans. We will therefore need to remove support for the Nullness Checker from NetBeans, until we find a proper solution.