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
🌐
DEV Community
dev.to › tschaka1904 › intellij-google-java-format-plugin-vs-intellij-java-google-style-xml-what-s-the-deal-197b
IntelliJ google-java-format plugin vs IntelliJ java-google-style.xml - what's the deal? - DEV Community
October 16, 2019 - The xml tries to mimic the Google style guides using IntelliJs built in code formatter and is written by a third party. The plugin comes directly from Google and seems to be a wrapper around the official formatter by Google as there are plugins ...
Discussions

What's the difference between google-java-format plugin and google java style xml file?
Hello, As far as I know, there are two ways to apply google java style for Intellij Install google-java-format plugin and enable it Download google style xml file and import it into File→Settings→E... More on github.com
🌐 github.com
5
December 11, 2021
eclipse-java-google-style.xml and intellij-java-google-style.xml are obsolete and should be removed
Both eclipse-java-google-style.xml and intellij-java-google-style.xml were last updated 4 years ago and are effectively obsolete. Google has moved its focus to google-java-format because “Eclipse a... More on github.com
🌐 github.com
0
April 25, 2022
Guide: Reformat Java Code with Google Style Guide in IntelliJ IDE
Next to the Scheme drop-down menu ... the intellij-java-google-style.xml file you downloaded from GitHub repository · Give the schema a name (or use the default GoogleStyle name from the import). Click OK or Apply for the settings to take effect. ... The google-java-format plugin uses ... More on github.com
🌐 github.com
0
August 21, 2024
Intellij XML Formatter is not in sync with the Plugin
The Intellij XML codestyle, found here, is not in sync with the Plugin. For our case the codestyle doesn't break the line at 100, causing LineLength to break. Either I need to bring the two in ... More on github.com
🌐 github.com
4
March 18, 2019
🌐
Google
google.github.io › styleguide › intellij-java-google-style.xml
intellij-java-google-style.xml
xmlns:android · xmlns:.* · BY_NAME · *:id · http://schemas.android.com/apk/res/android · style · *:.*Style
🌐
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
🌐
GitHub
github.com › google › styleguide › blob › gh-pages › intellij-java-google-style.xml
styleguide/intellij-java-google-style.xml at gh-pages · google/styleguide
<?xml version="1.0" encoding="UTF-8"?> <code_scheme name="GoogleStyle"> <option name="OTHER_INDENT_OPTIONS"> <value> <option name="INDENT_SIZE" value="2" /> <option name="CONTINUATION_INDENT_SIZE" value="4" /> <option name="TAB_SIZE" value="2" /> <option name="USE_TAB_CHARACTER" value="false" /> <option name="SMART_TABS" value="false" /> <option name="LABEL_INDENT_SIZE" value="0" /> <option name="LABEL_INDENT_ABSOLUTE" value="false" /> <option name="USE_RELATIVE_INDENTS" value="false" /> </value> </option> <option name="INSERT_INNER
Author: google
🌐
Cloudera
gerrit.cloudera.org › Documentation › dev-intellij.html
Gerrit Code Review - IntelliJ Setup
Those settings can’t completely mimic the format enforced by the google-java-format plugin but try to be as close as possible. So before submitting code, please make sure to run Reformat Code. ... Go to File → Settings → Editor → Code Style. Click on Manage. Click on Import.
🌐
JetBrains
plugins.jetbrains.com › plugin › 8527-google-java-format
google-java-format - IntelliJ IDEs Plugin | 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 ...
Find elsewhere
🌐
Googlesource
gerrit-review.googlesource.com › Documentation › dev-intellij.html
Gerrit Code Review - IntelliJ IDEA Setup
So before submitting code, please make sure to run Reformat Code. ... Go to File → Settings → Editor → Code Style. Click on the wrench icon with the tooltip Show Scheme Actions. Click on Import Scheme. Select the previously downloaded file intellij-java-google-style.xml...
🌐
javathinking
javathinking.com › blog › how-to-configure-google-java-code-formatter-in-intellij-idea-17
How to Configure Google Java Code Formatter in IntelliJ IDEA 17: Solving intellij-java-google-style.xml Import Issues — javathinking.com
The intellij-java-google-style.xml file is an XML-based configuration that encodes Google’s Java style rules (e.g., 4-space indentation, 100-character line length, braces on the same line as declarations). IntelliJ IDEA uses this file to enforce consistent formatting via its built-in code formatter.
🌐
GitHub
github.com › google › google-java-format › issues › 695
What's the difference between google-java-format plugin and google java style xml file? · Issue #695 · google/google-java-format
December 11, 2021 - Hello, As far as I know, there are two ways to apply google java style for Intellij Install google-java-format plugin and enable it Download google style xml file and import it into File→Settings→E...
Author: google
🌐
GitHub
github.com › google › styleguide › issues › 687
eclipse-java-google-style.xml and intellij-java-google-style.xml are obsolete and should be removed · Issue #687 · google/styleguide
April 25, 2022 - Both eclipse-java-google-style.xml and intellij-java-google-style.xml were last updated 4 years ago and are effectively obsolete. Google has moved its focus to google-java-format because “Eclipse and IntelliJ IDEA weren’t flexible enough to meet all the requirements of the Google Java Style Guide,” as described in google/google-java-format#695.
Author: google
🌐
GitHub
github.com › BrightProgrammer7 › FORMAT-JAVA-CI › issues › 4
Guide: Reformat Java Code with Google Style Guide in IntelliJ IDE · Issue #4 · BrightProgrammer7/FORMAT-JAVA-CI
August 21, 2024 - Next to the Scheme drop-down menu select the gear icon then Import Scheme > IntelliJ IDEA code style XML then import the intellij-java-google-style.xml file you downloaded from GitHub repository · Give the schema a name (or use the default ...
Author: BrightProgrammer7
🌐
SourceForge
sourceforge.net › projects › google-java-format.mirror
google-java-format download | SourceForge.net
July 30, 2026 - Click the Marketplace tab, search for the google-java-format plugin, and click the Install button. You can use the formatter through the formatSource methods ... Include the library in your maven/gradle/etc. configuration · IntelliJ, Android ...
🌐
GitHub
raw.githubusercontent.com › google › styleguide › gh-pages › intellij-java-google-style.xml
<?xml version="1.0" encoding="UTF-8"?> <code_scheme name="GoogleStyle">
<?xml version="1.0" encoding="UTF-8"?> <code_scheme name="GoogleStyle"> <option name="OTHER_INDENT_OPTIONS"> <value> <option name="INDENT_SIZE" value="2" /> <option name="CONTINUATION_INDENT_SIZE" value="4" /> <option name="TAB_SIZE" value="2" /> <option name="USE_TAB_CHARACTER" value="false" /> <option name="SMART_TABS" value="false" /> <option name="LABEL_INDENT_SIZE" value="0" /> <option name="LABEL_INDENT_ABSOLUTE" value="false" /> <option name="USE_RELATIVE_INDENTS" value="false" /> </value> </option> <option name="INSERT_INNER_CLASS_IMPORTS" value="true" /> <option name="CLASS_COUNT_TO_U
🌐
Google
android.googlesource.com › platform › external › google-java-format › + › 8612b8937d1dde47f0078918ccda945310a65bdc › README.md
google-java-format
A google-java-format IntelliJ plugin is available from the plugin repository. To install it, go to your IDE's settings and select the Plugins category.
🌐
GitHub
github.com › google › google-java-format › issues › 356
Intellij XML Formatter is not in sync with the Plugin · Issue #356 · google/google-java-format
March 18, 2019 - The Intellij XML codestyle, found here, is not in sync with the Plugin. For our case the codestyle doesn't break the line at 100, causing LineLength to break. Either I need to bring the two in sync, or need to the change the checkstyle for the google found from here: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
Author: google
🌐
GitHub
github.com › google › google-java-format › issues › 3
Provide IntelliJ Code Styles XML · Issue #3 · google/google-java-format
May 15, 2015 - Square has a GitHub project that configures IntelliJ just the way we like it: https://github.com/square/java-code-styles Since a lot of users of this project will also be IntelliJ users, it would b...
Author: google
🌐
Medium
medium.com › @alexprut › integrate-google-java-style-guide-in-a-java-project-567abb6d7987
Integrate Google Java Style Guide in a Java project | by Alex Prut | Medium
July 28, 2019 - Download the IntelliJ Java Google Style file, then go to IntelliJ IDEA→Preferences→Editor→Code Style→Java→Config Button (near theScheme label)→Import Scheme→IntelliJ IDEA code style XML→now select the previously downloaded file.