openjdk@21

Deprecation date: 2028-09-30

Disable date: 2031-09-30

Install command:
brew install openjdk@21

Development kit for the Java programming language

https://openjdk.org/

License: GPL-2.0-only WITH Classpath-exception-2.0

Development: Pull requests

Formula JSON API: /api/formula/openjdk@21.json

Formula code: openjdk@21.rb on GitHub

Bottle (binary package) installation support provided for:

macOS on
Apple Silicon
golden gate ✅
tahoe ✅
sequoia ✅
Linux ARM64 ✅
x86_64 ✅

Current versions:

stable ✅ 21.0.13.0.3

Other versions:

openjdk@25 25.0.5.0.3 Development kit for the Java programming language
openjdk@17 17.0.21.0.3 Development kit for the Java programming language
openjdk@11 11.0.33 Development kit for the Java programming language
openjdk@8 1.8.0-512 Development kit for the Java programming language

Keg-only because this is an alternate version of another formula.

Depends on:

freetype 2.15.0 Software library to render fonts
giflib 6.1.3 Library and utilities for processing GIFs
harfbuzz 15.1.0 OpenType text shaping engine
jpeg-turbo 3.2.1 JPEG image codec that aids compression and decompression
libpng 1.6.59 Library for manipulating PNG images
little-cms2 2.19.1 Color management engine supporting ICC profiles

Depends on when building from source:

autoconf 2.73 Automatic configure script builder
pkgconf 3.0.10 Package compiler and linker metadata toolkit

Uses from macOS: unzip (build), zip (build), cups (no_linkage)

Requires: Xcode (build)

Binaries: jar, jarsigner, java, javac, javadoc, javap, jcmd, jconsole, jdb, jdeprscan, jdeps, jfr, jhsdb, jimage, jinfo, jlink, jmap, jmod, jpackage, jps, jrunscript, jshell, jstack, jstat, jstatd, jwebserver, keytool, rmiregistry, serialver

For the system Java wrappers to find this JDK, symlink it with
    sudo ln -sfn $HOMEBREW_PREFIX/opt/openjdk@21/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-21.jdk

GitHub Packages downloads:

Last 30 days321,461
Downloads3,099,044
Analytics install events (30 days)41,282
Downloads / install events (30 days)7.8×

Source: GitHub Packages, fetched 2026-11-11T00:50:20Z. Analytics dates: 2026-10-12 to 2026-11-11. Totals exclude downloads from Bintray before the migration to GitHub Packages. Downloads and install attempts measure different things; the difference does not count analytics opt-outs. Definitions and limitations.

Analytics:

30 days90 days365 days
Installs41,21492,144332,906
Installs (--HEAD)68134413
Installs on Request31,97872,838266,556
Installs on Request (--HEAD)68134413
Build Errors365