From c474aed23dc40102c7a8cd4c10ad7b7b16b2c722 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Sat, 28 Nov 2026 19:20:30 +0300 Subject: [PATCH 1/2] Offer brew install on the Command line page and list the Homebrew tap The tap openjavaformat/homebrew-tap installs the native binary of the latest release on macOS and Linux and follows each new release within the hour. - Command line: a Homebrew section before the manual download, with the platforms it covers, why macOS does not quarantine the binary, and brew pin for holding a minor version. The download section now says that the Linux binaries need glibc 2.34 or later. - About: the tap in "Where it is published", and how it follows the GitHub releases. - Home page: the brew command next to the release downloads. --- docs/about.md | 5 ++++- docs/get-started/command-line.md | 23 ++++++++++++++++++++--- docs/index.md | 7 ++++++- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/about.md b/docs/about.md index 25ce6fc..8f52b99 100644 --- a/docs/about.md +++ b/docs/about.md @@ -13,11 +13,14 @@ project exists is in the [manifesto](manifesto.md). | [Gradle Plugin Portal](https://plugins.gradle.org/plugin/dev.openjavaformat.java-format) | `dev.openjavaformat.java-format` | | [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/34359-open-java-format) | the IntelliJ IDEA plugin | | [GitHub Releases](https://github.com/openjavaformat/open-java-format/releases/latest) | native binaries, the runnable jar, the Gradle, IntelliJ IDEA and Eclipse plugins | +| [Homebrew tap](https://github.com/openjavaformat/homebrew-tap) | `openjavaformat/tap/open-java-format`, the native binary for macOS and Linux | The Maven Central artifacts, the Gradle plugins and the files of a GitHub release are built by the [release workflow](https://github.com/openjavaformat/open-java-format/blob/main/.github/workflows/release.yml) from the tag of the version. The Maven plugin has a repository and a release workflow of its own, -[openjavaformat/fmt-maven-plugin](https://github.com/openjavaformat/fmt-maven-plugin). +[openjavaformat/fmt-maven-plugin](https://github.com/openjavaformat/fmt-maven-plugin). The Homebrew +formula installs the native binaries of the GitHub release: a workflow in the tap moves it to each +new release within the hour, once it has installed and tested it on every platform. ## Versions diff --git a/docs/get-started/command-line.md b/docs/get-started/command-line.md index 138d1cc..e11f465 100644 --- a/docs/get-started/command-line.md +++ b/docs/get-started/command-line.md @@ -1,7 +1,24 @@ # Command line The formatter comes as a native binary that needs no Java, and as a runnable jar for every platform -the binaries do not cover. +the binaries do not cover. On macOS and Linux, Homebrew installs the binary and keeps it current. + +## Homebrew + +``` sh +brew install openjavaformat/tap/open-java-format +open-java-format --version +``` + +The formula comes from our tap, [openjavaformat/homebrew-tap](https://github.com/openjavaformat/homebrew-tap). +It downloads the native binary of the latest release from GitHub, checks it against the release's +checksums and puts `open-java-format` on your `PATH`. It covers macOS on Apple silicon and Intel and +Linux on x86-64 and AArch64; on Windows, run it in WSL or download the binary below. Homebrew fetches +the file with `curl`, so macOS does not quarantine it. + +`brew upgrade` takes each new release, at the latest an hour after it is published. A new minor +version can change the output (see [Versions](../about.md#versions)): `brew pin open-java-format` +holds the installed one. ## Download @@ -17,8 +34,8 @@ Pick the file for your platform from the | Windows, x86-64 | `open-java-format-windows_x86-64.exe` | | Anything else with Java 21 or later | `open-java-format-{{ ojf_version }}-all.jar` | -There is no native binary for Windows on ARM or for musl-based Linux such as Alpine. Use the jar -there. +The Linux binaries need glibc 2.34 or later. There is no native binary for Windows on ARM or for +musl-based Linux such as Alpine. Use the jar there. ``` sh title="Native binary, here for Apple silicon" curl -LO https://github.com/openjavaformat/open-java-format/releases/download/{{ ojf_version }}/open-java-format-macos_aarch64 diff --git a/docs/index.md b/docs/index.md index 95be825..41a1c2f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -155,7 +155,12 @@ on the [Maven plugin](get-started/maven.md) page. ### On the command line Every [release](https://github.com/openjavaformat/open-java-format/releases/latest) carries native -binaries for Linux, macOS and Windows, and a runnable jar for Java 21 or later. +binaries for Linux, macOS and Windows, and a runnable jar for Java 21 or later. On macOS and Linux, +Homebrew installs the binary. + +``` sh title="Install with Homebrew" +brew install openjavaformat/tap/open-java-format +``` ``` sh title="Format files in place" open-java-format --replace src/main/java/com/example/Hello.java From 0ef2d34f5884f26b7b958002f86eeaf122eb7bf9 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Sat, 28 Nov 2026 19:57:27 +0300 Subject: [PATCH 2/2] Describe installing the command line tool with mise mise's github backend already installs the native binary from the GitHub release and verifies its digest and build attestation, so the Command line page gets a mise section next to Homebrew, with the per-project pin in mise.toml and the platforms where it picks the wrong file. --- docs/get-started/command-line.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/get-started/command-line.md b/docs/get-started/command-line.md index e11f465..60ccca8 100644 --- a/docs/get-started/command-line.md +++ b/docs/get-started/command-line.md @@ -1,7 +1,8 @@ # Command line The formatter comes as a native binary that needs no Java, and as a runnable jar for every platform -the binaries do not cover. On macOS and Linux, Homebrew installs the binary and keeps it current. +the binaries do not cover. On macOS and Linux, Homebrew installs the binary and keeps it current; +mise installs it on Windows too, and pins its version per project. ## Homebrew @@ -20,6 +21,31 @@ the file with `curl`, so macOS does not quarantine it. version can change the output (see [Versions](../about.md#versions)): `brew pin open-java-format` holds the installed one. +## mise + +``` sh +mise use github:openjavaformat/open-java-format@{{ ojf_version }} +open-java-format --version +``` + +[mise](https://mise.jdx.dev) installs the tool from the GitHub release with its +[github backend](https://mise.jdx.dev/dev-tools/backends/github.html): it picks the native binary for +your platform, checks it against the digest GitHub publishes and the release's build attestation, and +puts `open-java-format` on your `PATH`. That works on macOS, on Linux with glibc and on Windows +x86-64. On Windows on ARM and on musl-based Linux it would pick the wrong file, so use the jar there. + +`mise use` writes the version into the project's `mise.toml`, so everyone on the project formats with +the same one: + +``` toml title="mise.toml" +[tools] +"github:openjavaformat/open-java-format" = "{{ ojf_version }}" +``` + +Add `-g` to install it for your user instead of one project. Without a version, `mise use` writes +`latest`, and `mise upgrade` then takes each new release. A new minor version can change the output +(see [Versions](../about.md#versions)), which is why the example pins one. + ## Download Pick the file for your platform from the