Maven Tutorial for Beginners: How to Install Maven on Mac and Windows

:rocket: Struggling with Maven setup? You’re not alone!

In this tutorial, Koushik Chatterjee breaks it down step-by-step, from installing Maven on macOS & Windows to configuring paths and creating your very first Maven project in IntelliJ & terminal.

:sparkles: No more errors. No more confusion. Just a solid Maven foundation to kick-start your Java projects.

:point_right: Don’t miss it:

I’ve done this a bunch of times, on Mac, the easiest way is via Homebrew.

Steps:

Open Terminal.

Make sure Homebrew is installed:

brew --version

If not, install it from brew.sh .

Install Maven:

brew install maven

Verify installation:

mvn -version

You should see Maven’s version and Java info.

I like this method because it keeps Maven updated automatically whenever I run brew update && brew upgrade.

On Windows, I usually go for a manual installation,

here’s how:

Steps:

  • Download Maven from the Apache Maven website:

Extract the ZIP to a folder, e.g., C:\Program Files\Apache\Maven.

  • Set environment variables:

MAVEN_HOME → folder path, e.g., C:\Program Files\Apache\Maven\apache-maven-3.9.5

Add %MAVEN_HOME%\bin to your PATH.

  • Open Command Prompt and check:

mvn -version

It’s a bit manual, but once set up, Maven works smoothly with Eclipse, IntelliJ, or VS Code.

If you want something that works on Mac, Linux, and even Windows via WSL, I highly recommend SDKMAN.

Steps:

Install SDKMAN (Mac/Linux):
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

Install Maven via SDKMAN:

sdk install maven

Verify:


mvn -version

I like SDKMAN because you can switch between multiple Maven versions easily, super helpful when working on projects that require different versions.