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.

Top comments (0)