Oracle has a poor record for making it easy to install and configure Java, but using Homebrew, the latest OpenJDK (Java 14) can be installed with:
brew install --cask adoptopenjdk8
For the many use cases depending on an older version (commonly Java 8), the AdoptOpenJDK project makes it possible with an extra step.
brew tap adoptopenjdk/openjdk
brew install --cask adoptopenjdk8
Existing users of Homebrew may encounter Error: Cask adoptopenjdk8 exists in multiple taps due to prior workarounds with different instructions. This can be solved by fully specifying the location with brew install --cask adoptopenjdk/openjdk/adoptopenjdk8.
How to install Java on macOS Sonoma? - Apple Community
Unable to install Java 8 on MBP M4
How can I install java openjdk 8 on High Sierra or newer macOS - Ask Different
Java Runtime for Apple Silicon
Videos
Oracle has a poor record for making it easy to install and configure Java, but using Homebrew, the latest OpenJDK (Java 14) can be installed with:
brew install --cask adoptopenjdk8
For the many use cases depending on an older version (commonly Java 8), the AdoptOpenJDK project makes it possible with an extra step.
brew tap adoptopenjdk/openjdk
brew install --cask adoptopenjdk8
Existing users of Homebrew may encounter Error: Cask adoptopenjdk8 exists in multiple taps due to prior workarounds with different instructions. This can be solved by fully specifying the location with brew install --cask adoptopenjdk/openjdk/adoptopenjdk8.
Note: Oracle Java 8/9/10 is no longer available for public download (license change).
First install and update brew from Terminal:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew tap homebrew/cask-versions
brew update
NEW as of June 2019
To install the JDKs from AdoptOpenJDK:
brew tap adoptopenjdk/openjdk
brew install --cask adoptopenjdk8
brew install --cask adoptopenjdk9
brew install --cask adoptopenjdk10
brew install --cask adoptopenjdk11
OLD
Java 8:
brew install --cask java8
Java Latest:
brew install --cask java
Hello,
I need Java for some applications and I just downloaded the latest Java installer (jre-8u431-macosx-aarch64) from Oracle aaand โฆ it's not installing. It tries to install and says something like java could not be installed and "OS error code 1".
I searched for hours on Google and couldn't find anything. Did anyone have a solution to this? I'm running Sequoia 15.2.
Fastest Solution
Use the adoptopenjdk cask
See also https://discourse.brew.sh/t/how-to-install-openjdk-with-brew/712/4
To install latest:
brew install --cask adoptopenjdk
To install a specific version
brew tap AdoptOpenJDK/openjdk
brew install --cask adoptopenjdk8
brew install --cask adoptopenjdk9
Manual Solution
If you are looking to just bring down the binary without actually installing it, simply navigate to https://adoptopenjdk.net
I found this is the easiest way to download and install. Navigate here and choose platform.