🍺 BREW Explorer

← all formulae

google-java-format

brew install google-java-format v1.35.0 Apache-2.0

Reformats Java source code to comply with Google Java Style

116
30-day installs · #3270
575
90-day · #2742
4.5k
365-day · #2021
6.1k
★ GitHub stars · updated 2mo ago

Runtime dependencies

GitHub topics

formatter java

Links

Raw metadata
{
  "aliases": [],
  "alternatives": [],
  "build_dependencies": [],
  "categories": [],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [
    "openjdk"
  ],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Reformats Java source code to comply with Google Java Style",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:38:19+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "google-java-format",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-06-17T14:40:09Z",
  "github_readme_excerpt": "# google-java-format\n\n`google-java-format` is a program that reformats Java source code to comply with\n[Google Java Style][].\n\n[Google Java Style]: https://google.github.io/styleguide/javaguide.html\n\n## Using the formatter\n\n### From the command-line\n\n[Download the formatter](https://github.com/google/google-java-format/releases)\nand run it with:\n\n```\njava -jar /path/to/google-java-format-${GJF_VERSION?}-all-deps.jar \u003coptions\u003e [files...]\n```\n\nNote that it uses the `jdk.compiler` module to parse the Java source code. The\n`java` binary version used must therefore be from a JDK (not JRE) with a version\nequal to or newer than the Java language version of the files being formatted.\nThe minimum Java version can be found in `core/pom.xml` (currently Java 21). An\nalternative is to use the available GraalVM based native binaries instead.\n\nThe formatter can act on whole files, on limited lines (`--lines`), on specific\noffsets (`--offset`), passing through to standard-out (default) or altered\nin-place (`--replace`).\n\nOption `--help` will print full usage details; including built-in documentation\nabout other flags, such as `--aosp`, `--fix-imports-only`,\n`--skip-sorting-imports`, `--skip-removing-unused-import`,\n`--skip-reflowing-long-strings`, `--skip-javadoc-formatting`, or the `--dry-run`\nand `--set-exit-if-changed`.\n\nUsing `@\u003cfilename\u003e` reads options and filenames from a file, instead of\narguments.\n\nTo reformat changed lines in a specific patch, use\n[`google-java-format-diff.py`](https://github.com/google/google-java-format/blob/master/scripts/google-java-format-diff.py).\n\n***Note:*** *There is no configurability as to the formatter\u0027s algorithm for\nformatting. This is a deliberate design decision to unify our code formatting on\na single format.*\n\n### IntelliJ, Android Studio, and other JetBrains IDEs\n\nA\n[google-java-format IntelliJ plugin](https://plugins.jetbrains.com/plugin/8527)\nis available from the plugin repository. To install it, go to your IDE\u0027s\nsettings and select t",
  "github_repo": "google/google-java-format",
  "github_stars": 6147,
  "github_topics": [
    "formatter",
    "java"
  ],
  "homepage": "https://github.com/google/google-java-format",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 116,
  "installs_365d": 4532,
  "installs_90d": 575,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "Apache-2.0",
  "llm_generated_at": null,
  "llm_model": null,
  "name": "google-java-format",
  "oldnames": [],
  "one_liner": null,
  "optional_dependencies": [],
  "rank_30d": 3270,
  "rank_365d": 2021,
  "rank_90d": 2742,
  "raw_hash": "5979511998f0b0c3",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/g/google-java-format.rb",
  "tap": "homebrew/core",
  "test_dependencies": [],
  "uses_from_macos": [
    "python"
  ],
  "version_head": null,
  "version_stable": "1.35.0",
  "versioned_formulae": [],
  "why_use_this": null
}