How to Install Apache Maven on Windows, macOS & Linux

 📌Install Apache Maven on Windows, macOS & Linux


Introduction

Apache Maven is a build automation and project management tool used in Java. Let’s see how to install it on Windows, macOS, and Linux step by step.


🔹 Step 1: Download Maven

  • Go to: https://maven.apache.org/download.cgi

  • Download Binary ZIP (Windows) or TAR.GZ (macOS/Linux).

  • Extract to:

    • WindowsC:\Program Files\Apache\maven

    • macOS/Linux/usr/local/apache-maven


🔹 Step 2: Configure Environment Variables

🖥️ Windows

  1. Right-click This PC → Properties → Advanced system settings

  2. Go to Advanced → Environment Variables

  3. Add new system variable:

    • M2_HOME = C:\Program Files\Apache\maven

  4. Edit Path → Add:

    %M2_HOME%\bin

🍏 macOS

  1. Open Terminal

  2. Edit shell profile:

    • nano ~/.zshrc (zsh – default in latest macOS)

    • nano ~/.bash_profile (bash)

  3. Add these lines:

    export M2_HOME=/usr/local/apache-maven export PATH=$M2_HOME/bin:$PATH
  4. Save the file, then run:

    source ~/.zshrc

🐧 Linux

  1. Open Terminal

  2. Edit your profile file:

    • nano ~/.bashrc (or ~/.zshrc)

  3. Add these lines:

    export M2_HOME=/usr/local/apache-maven export PATH=$M2_HOME/bin:$PATH
  4. Save the file and reload with:

    source ~/.bashrc

🔹 Step 3: Verify Installation

Open a terminal/command prompt and type:

mvn -version

If installed correctly, it will show the Maven version, Java version, and OS details.

👉Watch how to install Apache Maven on Windows, macOS & Linux in Action

Here's a quick video to install Apache Maven on Windows, macOS & Linux in Action better: Install Apache Maven & Set Environment Variables | Step by Step (Hindi)

✅ Conclusion

Now Apache Maven is installed on your system 🎉. You can use it to build Java projects, manage dependencies, and automate tasks across Windows, macOS, and Linux.


💼 Professional Support Available

If you are facing issues in real projects related to enterprise backend development or workflow automation, I provide paid consulting, production debugging, project support, and focused trainings.

Technologies covered include Java, Spring Boot, PL/SQL, Azure, and workflow automation (jBPM, Camunda BPM, RHPAM).

🎥 Learn IT with Shikha on YouTube

Prefer learning through videos? Watch practical tutorials on Kafka, Camunda, Alfresco, Java, Spring Boot, Microservices and Enterprise Architecture.

▶ Subscribe to Learn IT with Shikha on YouTube

Comments

Popular posts from this blog

Top 50 Camunda BPM Interview Questions and Answers for Developers (2026 Guide)

10 BPMN Best Practices Every Camunda Developer Should Know

OOPs Concepts in Java | English | Object Oriented Programming Explained