DEV Community

Bharath Muppa
Bharath Muppa

Posted on

Installing Java on Mac.

Java is a powerful programming language that can be used to develop a wide range of applications. If you're a developer or a student who needs to use Java, you'll need to install it on your Mac.

In this article, we'll see how to install Java on macOS using SDKMAN, a popular tool for managing Java versions, and other alternatives to try out.

  1. SDKMan
  2. Home brew
  3. asdf
  4. Jabba
  5. jEnv

Which is better?

It deponds

Nope, not gonna say that. I will explain what worked for me.

I have tried HomeBrew, asdf, and sdkman. Here is my analysis of those tools.

HomeBrew - Steep learning curve (formulae, cask, Tapping, unTapping).
Worth spending time on if you are accepting home brew as your mac package manager and gonna use it for a long time, not for those who need only java installation.

Asdf - easy to use, but community and contributors for the java plugin are less active compared to others.

SDKMan - Easy to use and active community. I preferred this. it is pretty straightforward.

Install using SDKMan

  1. Open the terminal and run curl -s "https://get.sdkman.io" | bash
  2. Then run source "$HOME/.sdkman/bin/sdkman-init.sh"
  3. Then run sdk install java 20-tem to get the latest temurin version or just run sdk install java to get the latest stable version of temurin.
  4. you can try sdk list java for choosing different vendors and install accordingly.
  5. packages installed using SDK will be in $HOME/.sdkman/candidates/java/current

It helped me to kick start my development on Mac as newbie to mac and hope it helps you too.

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay