# 使用 Homebrew, apt 安装 closure-compiler

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

## 安装

```sh
sudo av install brew:closure-compiler
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install closure-compiler
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install closure-compiler
```

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

## 软件包事实

- **软件包键:** brew:closure-compiler
- **软件包管理器:** Homebrew
- **版本:** 20260726
- **来源摘要:** JavaScript optimizing compiler
- **主页:** <https://developers.google.com/closure/compiler>
- **最后更新:** 2026-07-28T03:32:42Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- closure-compiler (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

Closure Compiler is Google's JavaScript checker and optimizer, descended from the Closure Tools release that made Google's internal large-scale JavaScript tooling available to external developers. Its package-manager story is unusual because the compiler is a Java project with Maven distribution, npm wrappers, and OS package formulas rather than a single canonical CLI channel.

### 项目历史

Google introduced Closure Tools in 2009, including Closure Compiler, Closure Library, Closure Templates, and Closure Inspector. The compiler's role was to parse JavaScript, perform type and syntax checks, remove dead code, and rewrite code for smaller downloads and faster execution.

The current GitHub repository is maintained by Google and documents the compiler as a whole-program optimizer whose strongest mode, ADVANCED, expects code written with Closure Compiler's assumptions in mind. The README also records the project's long relationship with Closure Library style modules and its more limited fit with modern arbitrary JavaScript bundles.

### 采用历史

Google's launch post tied Closure Tools to JavaScript-heavy products such as Gmail, Google Docs, and Google Maps, which made the compiler historically important as a public version of infrastructure used in large browser applications.

Distribution broadened beyond direct Java JAR usage: the upstream README points to Maven artifacts and notes npm/Yarn installation through the separate google-closure-compiler npm packaging maintained outside Google. The Homebrew, Debian, and Ubuntu package-manager facts in the input show that the CLI also became a conventional system package.

### 使用方式

Typical CLI use compiles one or more JavaScript inputs to an output file, with SIMPLE or ADVANCED optimization levels. The compiler can also check types and conformance, transpile newer JavaScript for older browsers, emit source maps, and split output into loadable chunks.

The project is best treated as a specialized optimizer for codebases prepared for its rules, especially when property renaming, externs, and Closure-style module conventions matter.

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

Closure Compiler matters to package nerds because it crosses packaging cultures: Java artifacts, npm command wrappers, Linux distro packages, and Homebrew all expose the same optimizer with different expectations about runtime, update cadence, and command names.

It is also a useful example of a package whose canonical upstream warns that one popular distribution path, npm, is built by an outside maintainer from a separate repository, so package provenance matters.

### 时间线

- 2009: Google introduced Closure Tools and open sourced Closure Compiler.
- 2014: The current google/closure-compiler GitHub repository metadata was created.
- 2024: The README documented deprecation or reduced support for some non-ADVANCED and non-Closure-style module paths.

### Related projects

- Closure Library, Closure Templates, and Closure Inspector were announced with Closure Compiler as related Closure Tools.
- closure-compiler-npm is the separate npm packaging repository named by the upstream README.
- Modern JavaScript bundlers and minifiers overlap with Closure Compiler in SIMPLE-style minification, while Closure Compiler remains distinctive as a whole-program optimizer.

### 来源

- <https://developers.googleblog.com/introducing-closure-tools/>
- <https://developers.google.com/closure/compiler/docs/overview>
- <https://github.com/google/closure-compiler#readme>


## 安全说明

没有找到 closure-compiler 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


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

- Debian apt - closure-compiler - 20130227+rhino-2: normalized package name match | Debian stable package indexes: closure-compiler from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | JavaScript optimizing compiler | https://developers.google.com/closure/compiler/
- Debian apt - libclosure-compiler-java - 20130227+rhino-2: normalized package name match | Debian stable package indexes: libclosure-compiler-java from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | JavaScript optimizing compiler - library package | https://developers.google.com/closure/compiler/
- Debian apt - libclosure-compiler-java-doc - 20130227+rhino-2: normalized package name match | Debian stable package indexes: libclosure-compiler-java-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | JavaScript optimizing compiler - Javadoc | https://developers.google.com/closure/compiler/
- Ubuntu apt - closure-compiler - 20130227+rhino-2: normalized package name match | Ubuntu 24.04 LTS package indexes: closure-compiler from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | JavaScript optimizing compiler | https://developers.google.com/closure/compiler/
- Ubuntu apt - libclosure-compiler-java - 20130227+rhino-2: normalized package name match | Ubuntu 24.04 LTS package indexes: libclosure-compiler-java from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | JavaScript optimizing compiler - library package | https://developers.google.com/closure/compiler/
- Ubuntu apt - libclosure-compiler-java-doc - 20130227+rhino-2: normalized package name match | Ubuntu 24.04 LTS package indexes: libclosure-compiler-java-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | JavaScript optimizing compiler - Javadoc | https://developers.google.com/closure/compiler/


## Combined YAML source

View the package source record on GitHub. [combined/closure-compiler.yml](https://github.com/mxcl/pkgdb/blob/main/combined/closure-compiler.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
