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
🌐
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
🌐
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 plugin comes directly from Google and seems to be a wrapper around the official formatter by Google as there are plugins for other platforms as well. To be as close as possible to the code style, I'd suggest the plugin over the xml. I'm used to using Prettier but it seems they have no Java support currently.
🌐
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
🌐
Google
developers.google.com › j2objc › xmlformatter
XMLFormatter | J2ObjC | Google for Developers
XMLFormatter formats LogRecord data into a standard XML format as defined in the Java Logging APIs specification.
🌐
GitHub
github.com › google › styleguide › blob › gh-pages › eclipse-java-google-style.xml
styleguide/eclipse-java-google-style.xml at gh-pages · google/styleguide
<?xml version="1.0" encoding="UTF-8" standalone="no"?> ... <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
Author: google
🌐
GitHub
github.com › google › google-java-format › blob › master › pom.xml
google-java-format/pom.xml at master · google/google-java-format
Reformats Java source code to comply with Google Java Style. - google-java-format/pom.xml at master · google/google-java-format
Author: google
Find elsewhere
🌐
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 › 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
🌐
Google
android.googlesource.com › platform › external › google-java-format › + › 034d22c1cfed93c8142b68f0db86299fbb9613c4 › README.md
google-java-format
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). To reformat changed lines in a specific patch, use google-java-format-diff.py.
🌐
Maven Repository
mvnrepository.com › artifact › com.google.googlejavaformat › google-java-format
Maven Repository: com.google.googlejavaformat » google-java-format
July 30, 2026 - XML Processing · Web Frameworks · I/O Utilities · Code Generators · View All · Home » com.google.googlejavaformat » google-java-format · A Java source code formatter that follows Google Java Style. LicenseApache 2.0 · Tagsformatgoogle · Ranking · #2241in MvnRepository ·
🌐
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...
🌐
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.
🌐
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 - Click the Marketplace tab, search for the google-java-format plugin, and click theInstallbutton. The plugin will be disabled by default, you need to enable it manually. Alternatively, you can import the coding style in the IDE. 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.
🌐
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 › 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