Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ project exists is in the [manifesto](manifesto.md).
| [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 |
| [Scoop bucket](https://github.com/openjavaformat/scoop-bucket) | `openjavaformat/open-java-format`, the native binary for Windows |

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). 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.
formula and the Scoop manifest install the native binaries of the GitHub release. A workflow in the
tap and one in the bucket move them to each new release within the hour, once they have installed
and tested that release on every platform.

## Versions

Expand Down
30 changes: 24 additions & 6 deletions docs/get-started/command-line.md
Original file line number Diff line number Diff line change
@@ -1,8 +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;
mise installs it on Windows too, and pins its version per project.
the binaries do not cover. Homebrew on macOS and Linux and Scoop on Windows install the binary and
keep it current; mise installs it on all three and pins its version per project.

## Homebrew

Expand All @@ -14,13 +14,30 @@ 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.
Linux on x86-64 and AArch64; on Windows, use [Scoop](#scoop) or [mise](#mise). 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.

## Scoop

``` powershell
scoop bucket add openjavaformat https://github.com/openjavaformat/scoop-bucket
scoop install openjavaformat/open-java-format
open-java-format --version
```

The manifest comes from our bucket, [openjavaformat/scoop-bucket](https://github.com/openjavaformat/scoop-bucket).
It downloads the Windows x64 binary of the latest release from GitHub, checks it against the release's
checksums and puts `open-java-format` on your `PATH`, for your user and without administrator rights.
Scoop needs Git to add a bucket: run `scoop install git` first if you have none. On Windows 11 on
ARM, Scoop installs the same x64 binary, and Windows runs it under emulation.

`scoop update` fetches the bucket, and `scoop update open-java-format` then takes the new release, at
the latest an hour after it is published. `scoop hold open-java-format` holds the installed version.

## mise

``` sh
Expand Down Expand Up @@ -60,8 +77,9 @@ 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` |

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.
The Linux binaries need glibc 2.34 or later. There is no native binary for Windows on ARM, but
Windows 11 runs the x64 one under emulation. For musl-based Linux such as Alpine there is none: 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
Expand Down
9 changes: 7 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,18 @@ 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. On macOS and Linux,
Homebrew installs the binary.
binaries for Linux, macOS and Windows, and a runnable jar for Java 21 or later. Homebrew installs
the binary on macOS and Linux, and Scoop on Windows.

``` sh title="Install with Homebrew"
brew install openjavaformat/tap/open-java-format
```

``` powershell title="Install with Scoop"
scoop bucket add openjavaformat https://github.com/openjavaformat/scoop-bucket
scoop install openjavaformat/open-java-format
```

``` sh title="Format files in place"
open-java-format --replace src/main/java/com/example/Hello.java
```
Expand Down