To install OpenJDK on Mac running on Intel or M1/M2 ARM Apple Silicon chip, you can make use of the brew install openjdk command, but if you use it without any version of the lasted Java JDK will get installed which is JDK 18 as of September 2022.
Installing Specific Version of OpenJDK using Brew
Installing Java JDK 8 (ONLY WORKS FOR Intel x86_64)% brew install openjdk@8
Note: OpenJDK 8 is only available for x86_64 architecture,
so you will get an error if you are on ARM M1/M2 Chip.
openjdk@8: The x86_64 architecture is required for this software.
Error: openjdk@8: An unsatisfied requirement failed this build.
You will need to go for other vendors like azul.
brew tap homebrew/cask-versions
brew install --cask zulu8
Installing Java JDK 11
% brew install openjdk@11
Installing Java JDK 17
% brew install openjdk@17

-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to MacOS,
- Clear Screen shortcut macOS Terminal
- What is macOS Ventura?
- [fix] How to Show file extensions on all files on Mac
- How to Find Where Mac Terminal App is Located?
- AutoSave button not working on Office on Mac (Word, Excel or Powerpoint)
- macOS say command text to speech using various voices and languages
- How to change Ping TTL value on macOS
- Open .bash_profile File in TextEdit using Terminal
- How to know the Safari Version on Mac
- How to Copy full Absolute Path of a File on Mac
- 13.0 MacOS Ventura release date
- Enable spell check in Sublime Text (macOS)
- How to Display Analog Clock on Mac Menu Bar
- How to turn off Location Services macOS Ventura 13
- How to Open VS Code on Mac
- Add Bookmark macOS Safari
- How to Fix cd: too many arguments Error in Terminal: A Step-by-Step Guide
- How to install wget on macOS
- Select Line Number TextEdit on Mac
- Strikethrough Text in Excel for Mac
- How to Enable or Disable Dark Mode on macOS Ventura 13
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar
- How to install Yarn on Mac (macOS)
- How to fix command not found brew (bash, zsh) on macOS Terminal
- How to Schedule Mails in macOS Ventura
More Posts:
- Spotlight Search Mac Keyboard Shortcut - MacOS
- Step-by-Step: How to install Flutter in Android Studio - Android-Studio
- How to find the installed version of Microsoft Teams - Teams
- Python: Pandas Merge With Examples - Python
- Eclipse Java: Multiple markers at this line error - Eclipse
- Add new user in Ubuntu Linux using Terminal Command - Ubuntu
- Fix: error: src refspec master does not match any failed to push some refs to Git - Git
- 7 deadly java.lang.OutOfMemoryError in Java Programming - Java