# 使用 Homebrew, apt, MacPorts, Nix 安装 checkstyle

查看 checkstyle 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:checkstyle
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install checkstyle
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install checkstyle
```

  证据: MacPorts ports tree: java/checkstyle/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install checkstyle
```

  证据: Debian stable package indexes: checkstyle from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#checkstyle
```

  证据: nixpkgs package indexes: pkgs/by-name/ch/checkstyle/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:checkstyle
- **软件包管理器:** Homebrew
- **版本:** 13.9.0
- **来源摘要:** Check Java source against a coding standard
- **主页:** <https://checkstyle.sourceforge.io/>
- **仓库:** <https://github.com/checkstyle/checkstyle>
- **最后更新:** 2026-07-27T03:43:47Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- checkstyle (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 13.9.0
## 项目历史与用法

Checkstyle is a long-running Java code-quality tool for checking source code against coding standards. It is one of the classic packaged Java developer tools: available as a command-line jar, Maven artifact, build-tool integration, and operating-system package.

### 项目历史

The official site describes Checkstyle as a development tool that helps programmers write Java code adhering to a coding standard and automates checking tasks that would otherwise be manual. It is highly configurable and ships example configurations for Sun Code Conventions and Google Java Style.

The current GitHub repository was created in 2013, but the official site footer and release-note history identify the project as dating back to 2001. Modern releases continue under the checkstyle/checkstyle GitHub organization, with 13.7.0 published in June 2026.

### 采用历史

Checkstyle is distributed through GitHub releases and Maven Central according to the official README and website. The batch metadata also lists Homebrew, Debian, Ubuntu, MacPorts, and Nix, reflecting its role as both a Java build dependency and a standalone command-line tool.

The README points users to Maven artifacts, command-line usage, configuration documentation, discussions, Stack Overflow, Google Groups, and contributor channels, evidence of a mature tool with both user and maintainer communities.

### 使用方式

Typical command-line usage runs java -jar checkstyle-*-all.jar with a required configuration XML file and one or more files or folders. The official docs describe plain, XML, and SARIF output and the -c option for choosing the configuration.

In build systems, Checkstyle is commonly used through Maven or other Java build integrations to enforce project, company, Google, Sun, OpenJDK, or custom style rules.

### 为什么软件包爱好者会关心

Package nerds care about Checkstyle because it is a durable example of a Java quality tool that lives simultaneously in Maven Central, binary release pages, system package managers, and build plugins. It predates many modern linter ecosystems while still shipping frequent releases.

Its configuration model is also historically important: a tree of modules rooted at Checker, XML DTD/XSD validation, and style configuration files made it flexible enough for many organizations before language-server and formatter-first workflows became common.

### 时间线

- 2001: Checkstyle project history begins, according to the official site copyright range.
- 2013: checkstyle/checkstyle GitHub repository created.
- 2026: Checkstyle 13.7.0 released and official site published for version 13.7.0.

### Related projects

- Maven and the Maven Checkstyle Plugin are central distribution and build-integration paths.
- ANTLR, Apache Commons, Guava, and Picocli are libraries listed by the project; Google Java Style, Sun Code Conventions, and OpenJDK style are major configuration targets.

### 来源

- <https://checkstyle.org/>
- <https://checkstyle.org/cmdline.html>
- <https://checkstyle.org/config.html>
- <https://checkstyle.org/releasenotes.html>
- <https://github.com/checkstyle/checkstyle>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Debian apt - checkstyle - 8.36.1-1: normalized package name match | Debian stable package indexes: checkstyle from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | checks Java source against a coding standard | https://checkstyle.sourceforge.io/
- Debian apt - checkstyle-doc - 8.36.1-1: normalized package name match | Debian stable package indexes: checkstyle-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Documentation for Checkstyle | https://checkstyle.sourceforge.io/
- Nix - checkstyle: normalized package name match | nixpkgs package indexes: pkgs/by-name/ch/checkstyle/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - checkstyle - 8.36.1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: checkstyle from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | checks Java source against a coding standard | https://checkstyle.sourceforge.io/
- Ubuntu apt - checkstyle-doc - 8.36.1-1: normalized package name match | Ubuntu 24.04 LTS package indexes: checkstyle-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Documentation for Checkstyle | https://checkstyle.sourceforge.io/
- MacPorts - checkstyle: normalized package name match | MacPorts ports tree: java/checkstyle/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/checkstyle.yml](https://github.com/mxcl/pkgdb/blob/main/combined/checkstyle.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
