Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Static Analysis & Code Quality
  3. google-java-format

google-java-format

NOASSERTIONJavav1.35.0

A tool that automatically reformats Java source code to comply with Google Java Style guidelines.

GitHubGitHub
6.1k stars918 forks0 contributors

What is google-java-format?

google-java-format is a tool that automatically reformats Java source code to comply with the Google Java Style Guide. It parses Java files and applies consistent formatting rules, eliminating manual style adjustments and ensuring uniformity across codebases. The tool is designed to be integrated into command-line workflows, IDEs, and build processes.

Target Audience

Java developers and teams working on projects that adopt or enforce the Google Java Style Guide, particularly those in environments requiring consistent code formatting.

Value Proposition

It provides a zero-configuration, opinionated formatter that guarantees adherence to a widely recognized style guide, reducing time spent on code reviews about formatting and ensuring consistency across large codebases.

Overview

Reformats Java source code to comply with Google Java Style.

Use Cases

Best For

  • Enforcing Google Java Style across a team or organization
  • Automating code formatting in CI/CD pipelines
  • Integrating formatting into IDEs like IntelliJ or Eclipse
  • Formatting generated Java code from other tools
  • Applying consistent formatting to legacy Java codebases
  • Setting up pre-commit hooks for Java projects

Not Ideal For

  • Teams with established coding standards that diverge from the Google Java Style Guide
  • Environments where JVM flag configuration is restricted or cumbersome, such as locked-down CI/CD systems
  • Projects requiring fine-grained control over formatting rules, like custom indentation or brace placement

Pros & Cons

Pros

Zero Configuration Simplicity

Deliberately lacks formatting algorithm configurability, enforcing a single style to eliminate debates and ensure uniform formatting across all Java files, as stated in the README.

Comprehensive IDE Support

Offers plugins for IntelliJ, Android Studio, Eclipse, and VS Code, seamlessly replacing default formatting actions to enforce Google style without manual intervention.

Build Automation Ready

Integrates with Gradle, Maven, and SBT through third-party plugins, enabling automated formatting during build processes and in CI/CD pipelines, as listed in the README.

Embeddable as Library

Can be included as a Maven or Gradle dependency, allowing tools that generate Java code to output properly formatted source easily, with clear usage examples provided.

Cons

JRE Configuration Overhead

Requires adding multiple --add-exports JVM flags for JDK 16+, complicating setup in IDEs and command-line usage, as detailed in the README for IntelliJ and Eclipse.

No Algorithm Customization

Admits no configurability for the formatting algorithm, which is a deliberate design choice but can alienate teams with pre-existing style preferences or unique requirements.

Reliance on Internal APIs

Uses internal javac APIs, making it vulnerable to breaking changes with Java version updates and requiring ongoing maintenance to stay compatible.

Style Lock-in

Only supports the Google Java Style Guide (with an AOSP variant for 4-space indent), offering no flexibility for other popular styles like Sun or Oracle conventions.

Frequently Asked Questions

Quick Stats

Stars6,116
Forks918
Contributors0
Open Issues136
Last commit3 days ago
CreatedSince 2015

Tags

#ide-plugin#developer-tools#code-formatter#java#code-quality#static-analysis#formatter

Built With

M
Maven
J
Java

Included in

Static Analysis & Code Quality14.5k
Auto-fetched 1 day ago

Related Projects

PHP ParserPHP Parser

A PHP parser written in PHP

Stars17,426
Forks1,120
Last commit1 month ago
TypeScript ESLintTypeScript ESLint

:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript

Stars16,216
Forks2,904
Last commit1 day ago
pyrightpyright

Static Type Checker for Python

Stars15,387
Forks1,783
Last commit2 days ago
ReviewdogReviewdog

🐶 Automated code review tool integrated with any code analysis tools regardless of programming language

Stars9,236
Forks483
Last commit3 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub