DEV Community

Ajeet Singh Raina for Docker

Posted on • Edited on • Originally published at collabnix.com

7 3

How to setup Java on Apple Mac M1 Pro

Java™ is the world's leading programming language and platform. The Adoptium Working Group promotes and supports high-quality, TCK certified runtimes and associated technology for use across the Java™ ecosystem. Eclipse Temurin is the name of the OpenJDK distribution from Adoptium.

The Eclipse Temurin binaries are provided at no cost to you by Adoptium to use, forever, under the terms of the "GNU General Public License, version 2 with the Classpath Exception". The Eclipse Temurin™ project provides code and processes that support the building of runtime binaries and associated technologies that are high performance, enterprise-caliber, cross-platform, open-source licensed, and Java SE TCK-tested for general use across the Java ecosystem.

Follow the below steps to get OpenJDK installed in your macOS 12.4 Monterey:

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Install OpenJDK

$brew install --cask temurin
Enter fullscreen mode Exit fullscreen mode

Install a specific version

$brew tap homebrew/cask-versions
$sudo softwareupdate --install-rosetta
$brew install --cask temurin8
$brew install --cask temurin11
Enter fullscreen mode Exit fullscreen mode

Verify if Java is installed

The package installer will put the JDK into this location:
/Library/Java/JavaVirtualMachines/temurin-17.jdk/

java --version
openjdk 18.0.1 2022-04-19
OpenJDK Runtime Environment Temurin-18.0.1+10 (build 18.0.1+10)
OpenJDK 64-Bit Server VM Temurin-18.0.1+10 (build 18.0.1+10, mixed mode)
Enter fullscreen mode Exit fullscreen mode

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (1)

Collapse
 
lyoussi83 profile image
A.Karim LYOUSSI

Thank you very much for your help. ARM M1 / M2 / M3 new mac's architechture aren't easy to tame...

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay