Skip to content

Get started

open-java-format runs in the build, in the editor, on the command line and in CI. Every route uses the same formatter, so they all produce the same files. Set up the ones your project needs.

Requirements

The current version is 2.98.0.3. Everything except the native binaries needs Java 21 or later, and the Gradle plugin needs Gradle 9.

  • Gradle Gradle plugin


    Formats the lines you changed with formatDiff and keeps IntelliJ IDEA on the same formatter version as the build.

  • Spotless


    Works with Gradle through our plugin. Maven waits for a pull request in Spotless.

  • Command line


    A native binary for Linux, macOS and Windows, or a runnable jar anywhere else. Formats files in place or checks them.

  • IntelliJ IDEA IntelliJ IDEA


    Makes Reformat Code run open-java-format instead of the IDE's own Java formatter.

  • Eclipse IDE Eclipse


    Adds open-java-format as a formatter implementation for the Java editor.

  • GitHub Actions GitHub Action and pre-commit


    Fails a pull request, or stops a commit, when a Java file is not formatted.