Skip to content

Compatibility

Vladimir Sitnikov edited this page Sep 5, 2026 · 2 revisions

As of NullAway 0.13.0, the build must run on JDK 17 or later with Error Prone 2.36.0 or later. On JDK 17 there is also a ceiling: the newest Error Prone that runs there is 2.42.0. NullAway runs as an Error Prone plugin inside javac, so all three versions constrain each other; the README has the build setup itself.

Required versions

JDK running the build Error Prone NullAway
17 2.36.0 through 2.42.0 0.13.0 and later
21 or later 2.36.0 and later 0.13.0 and later
22 or later 2.36.0 and later 0.13.0 and later, and JSpecify mode needs no extra javac flag

These are requirements on the JVM that runs the compiler, not on the bytecode you produce; see Targeting an older JDK below.

The com.uber.nullaway:nullaway-annotations artifact is compiled for JDK 11, so putting it on a runtime classpath does not raise that classpath's requirement.

Error Prone 2.43.0 and later require JDK 21

Error Prone 2.43.0 dropped JDK 17; see Error Prone's release notes. On JDK 17 the newest Error Prone that runs is 2.42.0. To move past 2.42.0, raise the JDK the build runs on; --release keeps the bytecode at the version you already target.

JSpecify mode requires a newer javac

JSpecify mode needs a javac that reads type-use annotations from bytecode: JDK 22 or later, or -XDaddTypeAnnotationsToSymbol=true on a JDK that supports it. NullAway fails the build when neither holds. Supported JDK versions has the exact rule, the JDK 17 and 21 releases that accept the flag, and the error text.

Error Prone patching is broken in a range of versions

Error Prone's patch mode, which suppresses an existing codebase's warnings in bulk, does not work with NullAway in Error Prone versions after 2.25.0 and before 2.37.0, because of NullAway's requirement that an AnnotatedPackages option be passed (#1080). Use Error Prone 2.37.0 or later, or 2.25.0 or earlier, for that step.

Targeting an older JDK

JDK 17 or later is a requirement on the JVM that runs the compiler, not on the bytecode you produce. To produce bytecode for an older JDK, pass --release to javac and keep building with a recent JDK. This is the recommended setup: it picks up the latest javac and Error Prone fixes without changing what you ship.

Guava 33.4.1 and later

Guava annotates most of its packages @NullMarked as of 33.4.1, so NullAway checks calls into Guava more strictly whether or not JSpecify mode is on, and an upgrade can produce new errors. JSpecify and Guava explains what those errors are and how to address them.

Clone this wiki locally