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.
-
Formats the lines you changed with
formatDiffand keeps IntelliJ IDEA on the same formatter version as the build. -
Works with Gradle through our plugin. Maven waits for a pull request in Spotless.
-
A native binary for Linux, macOS and Windows, or a runnable jar anywhere else. Formats files in place or checks them.
-
Makes Reformat Code run open-java-format instead of the IDE's own Java formatter.
-
Adds open-java-format as a formatter implementation for the Java editor.
-
Fails a pull request, or stops a commit, when a Java file is not formatted.