Skip to content

Repository files navigation

Error Prone for IntelliJ IDEA

Error Prone's findings in the editor, on the code they are about — straight from your Gradle build.

Marketplace version Downloads Build License

Alt+Enter on an Error Prone highlight offers Error Prone's own fix, with a preview of the line it writes

Error Prone already runs in your build, but its findings end up in the build log as a file name and a line number. This plugin puts each one on the code it concerns, the way the IDE shows its own inspections, and lets you fix or suppress it from there. It uses your build's own Error Prone, flags and plugins, and runs no checks of its own: your build stays the source of truth.

Features

The Alt+Enter menu on an Error Prone highlight: apply Error Prone's fix, or suppress the check for the method

Fix or suppress with Alt+Enter

Apply Error Prone's own fix, imports included, with a preview of the line it writes. Or add @SuppressWarnings to the narrowest declaration around the diagnostic, or a wider one from the submenu. Either is one undoable edit.



The tooltip of a diagnostic: two checks on one expression, each with its message, suggested fix, link and the compile that reported it

Every finding explained where it is

An underline on the exact token. The tooltip has the check, the message, Error Prone's suggested fix, a link to the check's documentation, and which compile reported it and when.



The Error Prone tab of the Problems tool window, its diagnostics grouped by check

The whole build in one tab

A tab in the Problems tool window lists every diagnostic in the project, grouped by check or by file, with a filter and severity toggles. The details of the selection keep its fix, suppression and documentation a click away, and Ctrl+Alt+↓ steps to the next diagnostic even from the editor.



The context menu of a check in the Error Prone tab

A whole check at once

Apply the fixes of a check across its files, or suppress every diagnostic of it, each in its own declaration. Change Severity in Gradle… shows what turns the check off or makes it an error in your build.



A NullAway diagnostic in the editor, with its tooltip

Plugins included

Checks from Error Prone plugins such as NullAway show up like the built-in ones.



The commit panel saying that two Error Prone diagnostics are on lines this commit changes

What your change brings in

Changed Lines Only in the tab's filter shows the diagnostics on lines version control sees changed, and a commit whose changed lines have any asks first, from what the last builds reported, without compiling anything.



Also:

  • All fixes at once, by scope. Apply All Error Prone Fixes asks for a scope as Inspect Code does — the project, a module, a directory — and gathers every fix into one patch to review file by file.
  • Current after every edit. Two seconds after you stop typing near a diagnostic, the file is compiled quietly in the background, so a warning you fixed goes away without a build.

Getting started

  1. Install the plugin: Settings → Plugins → Marketplace, search for Error Prone. Or download the zip from Releases and use Install Plugin from Disk….

  2. Have Error Prone in your Gradle build, for example with the net.ltgt.errorprone plugin:

    plugins {
        java
        id("net.ltgt.errorprone") version "5.1.0"
    }
    
    dependencies {
        errorprone("com.google.errorprone:error_prone_core:2.50.0")
    }
  3. Run Error Prone once: Build → Run Error Prone recompiles every Java source set, so every file is analysed, and shows the results. From then on, the builds the IDE runs keep them current. If the Error Prone tab stays empty, it says why.

Requirements: IntelliJ IDEA 2026.1 or newer, Gradle 8.14 or newer, builds run from the IDE.

Where to find things

Where What
Alt+Enter on a highlight Apply Error Prone fix, Suppress with @SuppressWarnings
View → Tool Windows → Problems → Error Prone Every diagnostic, grouped and filterable
Build → Run Error Prone Recompile every Java source set in full, then show the Error Prone tab
Build → Apply All Error Prone Fixes… Every fix in a scope, as one patch; also under Code → Analyze Code and the Project view's Analyze
Settings → Tools → Error Prone Recompile in the background after edits near a diagnostic, after any edit of Java code, or never
The commit options Check Error Prone diagnostics on the lines a commit changes
Settings → Editor → Inspections → Error Prone Turn the highlighting off; Code → Inspect Code lists the diagnostics

How it works

When the IDE runs a Gradle build — Build Project, a Gradle task, a run configuration — Gradle reports every javac diagnostic through its Problems API. The plugin listens to those events over the Tooling API and keeps Error Prone's, with their file, line and column; no console output is parsed.

Each build updates what you see: a full compile replaces what its task reported before, an incremental one updates the files it recompiled, and an up-to-date one changes nothing. A failed compile only adds: Error Prone reports nothing once javac finds an error, so its silence proves nothing. Between builds the highlights follow your edits, a diagnostic whose line you delete or rewrite is hidden at once, and all of them survive an IDE restart.

FAQ

Nothing shows up.

The Error Prone tab says why when it is empty: no Gradle build linked, a Gradle older than 8.14, no Error Prone in the build as of the last sync, IntelliJ IDEA's own builder doing Build Project, or compiles that were up to date and so reported nothing. Builds run in a terminal (./gradlew build) do not reach the IDE at all. Build → Run Error Prone compiles everything again.

It says javac stopped at 100 warnings.

javac reports at most 100 warnings per compile task. Show How… in the notification shows what raises the limit, in Groovy or Kotlin, and which of the build's scripts apply Error Prone, where it goes. The plugin does not add it itself: a compiler argument that differs between IDE and terminal builds would make every switch between them recompile everything.

How do I turn a check off, or make it an error?

In the build, where Error Prone's configuration lives: the plugin never edits build scripts. Right-click the check in the Error Prone tab and choose Change Severity in Gradle…. It shows what to add, in Groovy or Kotlin, and links the build's scripts that apply Error Prone, where it goes. To silence one place instead, suppress it with Alt+Enter.

It reports on generated code.

Error Prone checks everything javac compiles. To leave generated sources out, set options.errorprone.excludedPaths = ".*/build/generated/.*" (or disableWarningsInGeneratedCode = true for code marked @Generated). Either way the plugin never applies a fix to generated code, which the next generation would undo.

A fix was not applied.

Error Prone keeps its fixes to itself until a build writes them out, so applying one runs a short Gradle build that needs the net.ltgt.errorprone plugin. A fix that uses a class the module does not have (a few use Guava), or whose code changed while the build ran, is left out; the notification says why and offers the patch to review.

Gradle's HTML problems report lists every warning now.

Gradle forwards only 15 warnings of a kind to the IDE unless told otherwise, and every Error Prone warning is one kind. The plugin raises that limit for the builds the IDE runs, and the report Gradle writes follows it.

Known limitations

  • Gradle only, and local builds only: Maven, the IDE's own build system, and builds in WSL, Docker or on a remote host are not supported.
  • Included builds need Gradle 9.7: before it, Gradle files their diagnostics under the root build's task of the same name. Run Error Prone recompiles an included build only when the root build depends on it; one it does not depend on updates when the IDE builds it.
  • A file changed while the IDE was closed (a pull, a checkout) loses its diagnostics until the next build compiles it.
  • An incremental build can leave a stale warning on a file that was recompiled only because a file it depends on changed. Run Error Prone clears it.
  • Recompiling after an edit follows edits near a diagnostic unless set to follow any edit, and waits while another Gradle task of the project runs, a running application or its tests included; the Error Prone tab says so.
  • A few checks read @SuppressWarnings on the class only (InconsistentCapitalization, for one): when a narrower suppression does not hold, the next build shows the diagnostic again, and the class is in the Suppress submenu.
  • Fixes cover a whole file: Error Prone writes all of a check's fixes in a file together, so Apply Error Prone fix applies them together.

Contributing

Building, testing and releasing are described in CONTRIBUTING.md. Bugs and ideas go to issues.

License

Apache License 2.0. Not affiliated with Google or the Error Prone project.

About

IntelliJ IDEA plugin that shows Error Prone and NullAway findings from your Gradle build right in the editor, and applies their fixes.

Topics

Resources

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages