If you use OpenJDK to build Java applications on a Mac using Homebrew, the brew command has changed again this year 2025.
Install Homebrew first
This blog post assumes that you have homebrew installed on your macOS.
If you do not have homebrew installed, you can install it with:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
You need to run the homebrew install script as admin or root user. It will fail if you do not have admin rights.
Homebrew command to install OpenJDK 8 or 1.8
The homebrew command to install Adopt OpenJDK 8 or 1.8 keeps changing.
As of September 2025, this command works:
brew install --cask adoptopenjdk/openjdk/adoptopenjdk8
Output:
$ brew install --cask adoptopenjdk/openjdk/adoptopenjdk8 ==> Auto-updating Homebrew... Adjust how often this is run with `$HOMEBREW_AUTO_UPDATE_SECS` or disable with `$HOMEBREW_NO_AUTO_UPDATE=1`. Hide these hints with `$HOMEBREW_NO_ENV_HINTS=1` (see `man brew`). ==> Tapping adoptopenjdk/openjdk Cloning into '/opt/homebrew/Library/Taps/adoptopenjdk/homebrew-openjdk'... remote: Enumerating objects: 2010, done. remote: Counting objects: 100% (74/74), done. remote: Compressing objects: 100% (29/29), done. remote: Total 2010 (delta 54), reused 62 (delta 45), pack-reused 1936 (from 1) Receiving objects: 100% (2010/2010), 376.78 KiB | 5.98 MiB/s, done. Resolving deltas: 100% (1434/1434), done. Tapped 47 casks (69 files, 527.0KB). Error: Unexpected method 'appcast' called on Cask adoptopenjdk8. Follow the instructions here: https://github.com/Homebrew/homebrew-cask#reporting-bugs ==> Downloading https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_mac_h Already downloaded: /Users/asjohn/Library/Caches/Homebrew/downloads/336d2dd4a6fc8c2c5a16f65fa9ff991ba34439ba280ae82088610af35ddfcbf6--OpenJDK8U-jdk_x64_mac_hotspot_8u292b10.pkg ==> Installing Cask adoptopenjdk8 Error: Unexpected method 'appcast' called on Cask adoptopenjdk8. Follow the instructions here: https://github.com/Homebrew/homebrew-cask#reporting-bugs ==> Running installer for adoptopenjdk8 with `sudo` (which may request your password)... Enter PIN for 'Certificate For PIV Authentication (Arul John (affiliate))': installer: Package name is AdoptOpenJDK installer: Installing at base path / installer: The install was successful. package-id: net.adoptopenjdk.8.jdk version: 1.8.0_292-b10 volume: / location: install-time: 1758896412 🍺 adoptopenjdk8 was successfully installed! ==> No outdated dependents to upgrade!
Verify Java installation
Verify that Java is installed with this:
java -version
Output:
$ java -version openjdk version "1.8.0_292" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)
Verify that javac is installed:
$ javac -version javac 1.8.0_292
Conclusion
Did this brew command work for you? Let me know in the comments.
Related Posts
If you have any questions, please contact me at arulbOsutkNiqlzziyties@gNqmaizl.bkcom. You can also post questions in our Facebook group. Thank you.