This problem can be solve installing the google-java-format Plugin.

  1. Open plugins window (CTRL+Shift+A): plugins

  2. Click on browse repositories.

  3. Search for google-java-format

  4. Install the plugin.

  5. Restart the IDE.

  6. Enable the plugin executing the action (Ctrl+Shift+A): Reformat with google-java-format Update: in the newer version of the plugin select Reformat since the plugin overrides / enhances the functionality of the standard "Reformat" command.

Additional notes from the google-java-format README

The plugin will be disabled by default. To enable it in the current project, go to File→Settings...→google-java-format Settings (or IntelliJ IDEA→Preferences...→Other Settings→google-java-format Settings on macOS) and check the Enable google-java-format checkbox. (A notification will be presented when you first open a project offering to do this for you.)

To enable it by default in new projects, use File→Other Settings→Default Settings....

Answer from Geekecom on Stack Overflow
🌐
GitHub
github.com › google › google-java-format
GitHub - google/google-java-format: Reformats Java source code to comply with Google Java Style. · GitHub
August 14, 2026 - google-java-format is a program that reformats Java source code to comply with Google Java Style. ... Note that it uses the jdk.compiler module to parse the Java source code. The java binary version used must therefore be from a JDK (not JRE) ...
Author: google
🌐
JetBrains
plugins.jetbrains.com › plugin › 8527-google-java-format
google-java-format Plugin for JetBrains IDEs | JetBrains Marketplace
June 27, 2025 - Formats source code using the google-java-format tool. This plugin requires additional IDE configuration. For more information, read the documentation. What’s New: 1.36.1.1. Move settings page to Tools section. 1.36.1.0. Updated to use google-java-format 1.36.1. 1.35.0.0. Updated to use google-java-format 1.35.0.
Discussions

What java formatter do you use for formatting source code?
🌐 r/java
19
15
July 23, 2021
Codestyle and formatters
Spotless? It can use the eclipse formatter which is pretty configurable, or the Google formatter, or others. More on reddit.com
🌐 r/java
27
18
October 21, 2024
🌐
SourceForge
sourceforge.net › projects › google-java-format.mirror
google-java-format download | SourceForge.net
July 30, 2026 - Reformats Java source code to comply with Google Java Style. google-java-format is a program that reformats Java source code to comply with Google Java Style. The formatter can act on whole files, on limited lines, on specific offsets, passing ...
🌐
Google
google.github.io › styleguide › javaguide.html
Google Java Style Guide
Lines where obeying the column limit is not possible (for example, a long URL in Javadoc, or a long JSNI method reference). package declarations and imports (see Sections 3.2 Package declarations and 3.3 Imports). Contents of text blocks. Command lines in a comment that may be copied-and-pasted into a shell. Very long identifiers, on the rare occasions they are called for, are allowed to exceed the column limit. In that case, the valid wrapping for the surrounding code is as produced by google-java-format.
🌐
Google
android.googlesource.com › platform › external › google-java-format › + › 8612b8937d1dde47f0078918ccda945310a65bdc › README.md
google-java-format
Version 1.6 of the google-java-format ... adds a google-java-format formatter implementation that can be configured in Window > Preferences > Java > Code Style > Formatter > Formatter Implementation....
Find elsewhere
🌐
Homebrew
formulae.brew.sh › formula › google-java-format
Homebrew Formulae: google-java-format
Reformats Java source code to comply with Google Java Style · https://github.com/google/google-java-format
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
google-java-format - Visual Studio Marketplace
Extension for Visual Studio Code - Yet another simple google-java-format runner
🌐
GitHub
github.com › google › google-java-format › releases
Releases · google/google-java-format
Reformats Java source code to comply with Google Java Style. - google/google-java-format
Author: google
🌐
Google
android.googlesource.com › platform › external › google-java-format
platform/external/google-java-format - Git at Google
google-java-format is a program that reformats Java source code to comply with Google Java Style. ... The formatter can act on whole files, on limited lines (--lines), on specific offsets (--offset), passing through to standard-out (default) or altered in-place (--replace).
🌐
GitHub
github.com › hferreiro › google-java-format
GitHub - hferreiro/google-java-format: Reformats Java source code to comply with Google Java Style. · GitHub
google-java-format is a program that reformats Java source code to comply with Google Java Style. ... Note that it uses the jdk.compiler module to parse the Java source code. The java binary version used must therefore be from a JDK (not JRE) ...
Author: hferreiro
🌐
Domyassignments
domyassignments.com › home › introduction to google java coding style
Introduction to Google Java Coding Style
March 1, 2024 - Search for “Google Java Format” and install the plugin. Configure Formatter: Once installed, go to Window > Preferences > Java > Code Style > Formatter and select the Google formatter.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Google Java Format for VS Code - Visual Studio Marketplace
Extension for Visual Studio Code - Visual Studio Code extension to format Java files using google-java-format program to comply with Google Java Style.
🌐
Reddit
reddit.com › r/java › codestyle and formatters
r/java on Reddit: Codestyle and formatters
October 21, 2024 -

Hi y'all,

My team would like to standardise code formatting and enforce it in CI. We've tried google-java-formatter but it doesn't look nearly as good as inteliJ's default settings.

Ideally, we'd like to export inteliJs defaults (to have the benefits of built in formatter) and use something that would enforce it on CI build. Has anyone done it? What are your pipelines like? Any tips and tricks?

🌐
Seth Vargo
sethvargo.com › using-google-java-format-with-vs-code
Using google-java-format with VS Code | Seth Vargo
January 12, 2020 - Google publishes a verbose Google Java style guide as well as google-java-format which reformats Java code according to that style guide. The formatter is available as a Java JAR and via popular package managers.
🌐
Medium
medium.com › @nirav-shah › code-formatting-using-spotless-google-java-format-for-java-maven-projects-with-git-pre-commit-860d6c15bf7c
Code Formatting Using Spotless & Google Java Format for Java Maven Projects with Git Pre Commit Hooks | by Nirav Shah | Medium
September 21, 2023 - Spotless can format a code written in different languages. We are going to use Spotless Maven Plugin. You can explore other language option over here. Google Java Format is a program written to format a java code using Google Java Style
🌐
Baeldung
baeldung.com › home › java › formatting java code from the command line
Formatting Java Code From the Command Line | Baeldung
May 13, 2026 - astyle provides many more options that can customize the formatting of source code both in Java and other languages. google-java-format is another option for formatting Java code from the command line. It formats source code using Google Java Style.
🌐
GitHub
github.com › google › styleguide › blob › gh-pages › eclipse-java-google-style.xml
styleguide/eclipse-java-google-style.xml at gh-pages · google/styleguide
<profile kind="CodeFormatterProfile" name="GoogleStyle" version="13"> <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> <setting id=
Author: google