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.
Which is better?
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
- Open the terminal and run
curl -s "https://get.sdkman.io" | bash
- Then run
source "$HOME/.sdkman/bin/sdkman-init.sh"
- Then run
sdk install java 20-tem
to get the latest temurin version or just runsdk install java
to get the latest stable version of temurin. - you can try
sdk list java
for choosing different vendors and install accordingly. - 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)