# 使用 Homebrew, chocolatey, Nix, scoop 安装 jbang

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

## 安装

```sh
sudo av install brew:jbang
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install jbang
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#jbang
```

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

### Windows

- Chocolatey (92%):

```sh
choco install jbang
```

  证据: Chocolatey community package catalog: jbang from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','java7u13x86'

- Scoop (92%):

```sh
scoop install main/jbang
```

  证据: Scoop official bucket manifest trees: bucket/jbang.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:jbang
- **软件包管理器:** Homebrew
- **版本:** 0.141.0
- **来源摘要:** Tool to create, edit and run self-contained source-only Java programs
- **主页:** <https://jbang.dev/>
- **仓库:** <https://github.com/jbangdev/jbang>
- **最后更新:** 2026-07-14T06:33:35Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- jbang (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

JBang is a command-line tool for writing, running, editing, sharing, and installing source-only Java programs without creating a traditional Maven or Gradle project first. It brings shebang-style scripting, dependency directives, catalog aliases, and IDE integration to Java.

### 项目历史

The JBang FAQ says Max Rydahl Andersen came to the idea while exploring Java 10 shebang support and the Kotlin kscript project, asking why the same style could not be done with Java. The FAQ says JBang was released in December 2019.

The repository README frames JBang as a way to run .java files directly, declare Maven dependencies with //DEPS, work with Java, Kotlin, Groovy, JShell, and Markdown, open scripts in IDEs, build native binaries with GraalVM, and share scripts through GitHub URLs, aliases, and catalogs.

### 采用历史

JBang spread through Java developer tooling channels rather than through one application framework: the official README lists SDKMAN, Homebrew, Chocolatey, and Scoop installs, and the FAQ links to talks, articles, podcasts, and Quarkus-related presentations. The package metadata in the input also shows Homebrew, Chocolatey, Nix, and Scoop coverage.

### 使用方式

A common JBang script starts with a comment-form shebang line, uses directives such as //DEPS and //JAVA, and runs with the jbang command. Users can also initialize templates, edit generated IDE projects, install commands as apps, run remote scripts, manage aliases and catalogs, and export scripts toward richer project or native-image forms.

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

JBang is package-nerd significant because it treats Maven Central as a scripting package universe. It reduces the gap between one-file scripts and full JVM applications, giving Java a workflow closer to Python, shell, or Node command snippets while keeping Java libraries, IDEs, and GraalVM in play.

### 时间线

- 2019: JBang is released in December, according to the FAQ.
- 2021: JBang documentation is built with Antora and published under jbang.dev.
- 2020s: JBang adds catalog aliases, app installation, IDE integration, multiple source languages, and native-image workflows.
- 2026: The repository release notes document a CLI parser migration from picocli to Aesh and early-access native binary distribution work.

### Related projects

- JBang is related to Java 10 single-file source execution, kscript, Maven Central, SDKMAN, Chocolatey, Scoop, GraalVM native-image, Quarkus command-line workflows, JShell, Groovy, Kotlin, and Java build tools such as Maven and Gradle.

### 来源

- <https://github.com/jbangdev/jbang>
- <https://github.com/jbangdev/jbang/releases>
- <https://www.jbang.dev/documentation/guide/latest>
- <https://www.jbang.dev/documentation/jbang/latest/faq.html>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

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


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.jbang/, jbang-catalog.json, .jbang/jbang-catalog.json
## 其他软件包管理器记录

- Nix - jbang: normalized package name match | nixpkgs package indexes: pkgs/by-name/jb/jbang/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Chocolatey - jbang: normalized package name match | Chocolatey community package catalog: jbang from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','java7u13x86'
- Scoop - main/jbang: normalized package name match | Scoop official bucket manifest trees: bucket/jbang.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

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


## 来源

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