# 使用 Homebrew, chocolatey, Nix, winget, dnf, zypper 安装 openjdk

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

## 安装

```sh
sudo av install brew:openjdk
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install openjdk
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#openjdk
```

  证据: nixpkgs package indexes: openjdk from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- dnf (92%):

```sh
sudo dnf install java-25-openjdk
```

  证据: Fedora Rawhide package metadata: java-25-openjdk from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- zypper (92%):

```sh
sudo zypper install java-11-openj9
```

  证据: openSUSE Tumbleweed package metadata: java-11-openj9 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install openjdk
```

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

- winget (92%):

```sh
winget install --id Microsoft.OpenJDK.17 -e
```

  证据: Windows Package Manager source index: Microsoft.OpenJDK.17 from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:openjdk
- **软件包管理器:** Homebrew
- **版本:** 26.0.2
- **来源摘要:** Development kit for the Java programming language
- **主页:** <https://openjdk.org/>
- **仓库:** <https://github.com/openjdk/jdk26u>
- **最后更新:** 2026-07-27T15:13:27Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- jar (别名)
- jarsigner (别名)
- java (别名)
- javac (别名)
- javadoc (别名)
- javap (别名)
- jcmd (别名)
- jconsole (别名)
- jdb (别名)
- jdeprscan (别名)
- jdeps (别名)
- jfr (别名)
- jhsdb (别名)
- jimage (别名)
- jinfo (别名)
- jlink (别名)
- jmap (别名)
- jmod (别名)
- jnativescan (别名)
- jpackage (别名)
- jps (别名)
- jshell (别名)
- jstack (别名)
- jstat (别名)
- jstatd (别名)
- jwebserver (别名)
- keytool (别名)
- rmiregistry (别名)
- serialver (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

OpenJDK is the open-source implementation community for the Java Platform, Standard Edition, and the upstream source base from which many Java Development Kit distributions are built. The Homebrew openjdk formula packages the general JDK toolchain: java, javac, jar, javadoc, jshell, jlink, jpackage, jcmd, jfr, keytool, and many diagnostic utilities.

### 项目历史

OpenJDK began from Sun Microsystems' 2006 initiative to open source Java and the core Java platform. Red Hat's historical account says the major platform components were released over the next few years as free and open-source software under the GPL.

After Sun's acquisition by Oracle, OpenJDK continued as the central upstream for Java SE implementation work. The OpenJDK homepage describes it as the place to collaborate on an open-source implementation of Java SE and related projects, while the JDK Project describes its goal as producing a series of open-source reference implementations of the Java SE Platform.

### 采用历史

OpenJDK became the shared upstream for a multi-vendor Java ecosystem. Oracle, Red Hat, IBM, Microsoft, Amazon, Azul, SAP, and other vendors build or support JDK distributions derived from the OpenJDK code base, while the OpenJDK Community develops language, VM, library, tooling, and platform features through projects and JEPs.

The release model changed after JDK 9. OpenJDK's JDK Project documents a six-month feature-release cadence, and JEP 14 describes the tip-and-tail model: frequent feature releases at the tip, quarterly update releases in tail trains, and vendor-designated long-term support lines such as JDK 8, 11, 17, and 21.

### 使用方式

Developers install OpenJDK when they need the Java compiler, runtime, standard libraries, build tools, documentation tools, packaging tools, and diagnostics needed to build and run Java software. Operators often install it indirectly because build systems, language servers, CI jobs, application servers, Android-adjacent tooling, and JVM languages all expect a JDK on PATH or discoverable through platform Java wrappers.

On macOS, Homebrew marks openjdk as keg-only and documents the symlink needed for /usr/libexec/java_home and other system Java wrappers to find the JDK bundle. That detail is a classic Java-packaging issue: package managers can install many JDKs, but tools need a policy for which one wins.

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

OpenJDK is one of the most consequential packages in a package manager because it is both a developer-facing SDK and a build-time dependency for other packages. It also carries a distinctive license shape, GPLv2 with the Classpath Exception, which lets the JDK remain copyleft while supporting broad Java application distribution.

### 时间线

- 2006: Sun Microsystems announced the initiative that led to OpenJDK.
- 2007: Red Hat signed Sun's OpenJDK contributor and TCK agreements, becoming a major outside participant in the project.
- 2018: the OpenJDK Community adopted the six-month tip-and-tail release model beginning with JDK 10.
- The JDK Project release list records JDK 11 general availability on 25 September 2018 and subsequent feature releases on a six-month cadence.

### Related projects

- OpenJDK is related to HotSpot, javac, Project Amber, Project Loom, Project Panama, Project Valhalla, OpenJDK update projects, Eclipse OpenJ9, and downstream distributions such as Oracle OpenJDK builds, Red Hat OpenJDK builds, Microsoft Build of OpenJDK, Amazon Corretto, Azul Zulu, SAP SapMachine, and Eclipse Temurin.

### 来源

- <https://formulae.brew.sh/formula/openjdk>
- <https://openjdk.org/>
- <https://openjdk.org/jeps/14>
- <https://openjdk.org/legal/gplv2+ce.html>
- <https://openjdk.org/projects/jdk/>
- <https://www.redhat.com/en/blog/history-and-future-openjdk>


## 安全说明

Java runtime and development kit.

- **Geiger 风险:** yellow / 高
- Java runtime and development kit

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

- Nix - openjdk: normalized package name match | nixpkgs package indexes: openjdk from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Chocolatey - openjdk: normalized package name match | Chocolatey community package catalog: openjdk from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','openconnect-gui'
- winget - Microsoft.OpenJDK.17: normalized package name match | Windows Package Manager source index: Microsoft.OpenJDK.17 from https://cdn.winget.microsoft.com/cache/source.msix
- winget - ojdkbuild.ojdkbuild: normalized package name match | Windows Package Manager source index: ojdkbuild.ojdkbuild from https://cdn.winget.microsoft.com/cache/source.msix
- dnf - java-25-openjdk - 25.0.4.0.7-1.1.fc45: installed executable or alias match | Fedora Rawhide package metadata: java-25-openjdk from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | OpenJDK 25 Runtime Environment | http://openjdk.java.net/
- zypper - java-11-openj9 - 11.0.31.0-4.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-11-openj9 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 11 Runtime Environment with Eclipse OpenJ9 virtual machine | https://openjdk.java.net/
- zypper - java-11-openjdk - 11.0.32.0-1.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-11-openjdk from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 11 Runtime Environment | https://openjdk.java.net/
- zypper - java-17-openj9 - 17.0.19.0-4.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-17-openj9 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 17 Runtime Environment with Eclipse OpenJ9 virtual machine | https://openjdk.java.net/
- zypper - java-17-openjdk - 17.0.20.0-1.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-17-openjdk from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 17 Runtime Environment | https://openjdk.java.net/
- zypper - java-1_8_0-openj9 - 1.8.0.492-4.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-1_8_0-openj9 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 8 Runtime Environment with Eclipse OpenJ9 virtual machine | https://www.eclipse.org/openj9/
- zypper - java-1_8_0-openjdk - 1.8.0.492-4.3: installed executable or alias match | openSUSE Tumbleweed package metadata: java-1_8_0-openjdk from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 8 Runtime Environment | https://openjdk.java.net/
- zypper - java-21-openj9 - 21.0.11.0-4.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-21-openj9 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 21 Runtime Environment with Eclipse OpenJ9 virtual machine | https://openjdk.java.net/
- zypper - java-21-openjdk - 21.0.12.0-1.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-21-openjdk from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 21 Runtime Environment | https://openjdk.java.net/
- zypper - java-25-openj9 - 25.0.3.0-4.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-25-openj9 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 25 Runtime Environment with Eclipse OpenJ9 virtual machine | https://openjdk.java.net/
- zypper - java-25-openjdk - 25.0.4.0-1.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-25-openjdk from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 25 Runtime Environment | https://openjdk.java.net/
- zypper - java-26-openjdk - 26.0.2.0-1.2: installed executable or alias match | openSUSE Tumbleweed package metadata: java-26-openjdk from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | OpenJDK 26 Runtime Environment | https://openjdk.java.net/


## Combined YAML source

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