I will teach you the best way to download Apache Maven on all operating systems, such as Linux, Windows, and Mac, and how to set it up in under 5 minutes!
A quick overview before we begin the technical part! Apache Maven is a go-to command-line tool for Java developers, building and managing Java projects. Why? Because it’s simple, powerful, and incredibly reliable for documentation, dependencies, and reporting.
Launched on July 13, 2004, this project by the Apache Software Foundation, part of the Jakarta Project, focuses on software construction and managing dependencies. Created by Jason van Zyl, it features a plugin-based architecture for controlling applications and dynamically downloading Java libraries.
Apache Maven download helps automate the build process, making it easier to develop Java applications. It uses a POM (Project Object Model) to create a consistent development environment for teams.
The Maven Project offers a ZIP file with a precompiled version of Maven, but there is no installer, so we need to prepare our environment to run it.
Let’s Learn Along!
Get exclusive access to all things tech-savvy, and be the first to receive
the latest updates directly in your inbox.
System Requirements Before You Download Apache Maven
You must have a Java Development Kit (JDK) installed. Set the JAVA_HOME variable to your JDK path or ensure the java executable is in your PATH. The stable version 3.9.9 needs JDK 8 or higher, but any recent version will be fine.
You can download the Java JDK from Oracle.
- An Internet connection
- Admin account access
- command prompt access
- Java is installed with JAVA_HOME set.
- A command-line interface (CLI) is available through Terminal on Linux/macOS or Command Prompt/PowerShell on Windows.
How to Download Apache Maven on Different Operating Systems!
On Windows
Install JDK
Download and install the current Java Development Kit (JDK) (e.g., JDK 17 or newer).
Set JAVA_HOME environment variable:
<br>JAVA_HOME = C:\Program Files\Java\jdk-17
Download Maven

- Navigate to the official Apache Maven download page.
- Download the Binary zip archive for Windows.
- Unpack it to a proper directory, e.g.:
<br>C:\Program Files\Apache\maven-3.9.6
Set Environment Variables
Add MAVEN_HOME:
<br>MAVEN_HOME = C:\Program Files\Apache\maven-3.9.6
Modify the Path variable:
<br>%MAVEN_HOME%\bin

Check Installation
Open Command Prompt and execute:

<br>mvn -version
You will see the Maven version, Java version, and OS information.
Download Apache Maven on macOS
Installation on macOS is supported by Homebrew, SDKMAN! and MacPorts.
To install Maven on Mac OS X, first download the latest version from the Apache Maven website, specifically the binary tar.gz file like apache-maven-3.8.4-bin.tar.gz.
Extract the file to your chosen location. Next, open the terminal and navigate to the extraction directory, logging in as superuser.
Remove the tar.gz file using the command:
rm Downloads/apache-maven<em>bin.tar.gz. </em>
Then, change the permissions and move the Maven files with: chown -R root:wheel Downloads/apache-maven and mv Downloads/apache-maven* /opt/apache-maven.
After that, exit the admin session and add Maven to your path by editing the profile file:
nano $HOME/.profile and adding export PATH=$PATH:/opt/apache-maven/bin.
Save and exit with Ctrl+x.
To apply the changes, run bash. Finally, check if Maven is installed correctly by typing mvn -version. You are now set to use Apache Maven on your Mac OS X.
Apache Maven Download on Ubuntu/Linux
The commands depend on the package manager of the Linux Distribution of your choice.
To set up Maven on Linux, download the latest version from the Apache Maven download website, specifically the binary tar.gz file like apache-maven-3.8.4-bin.tar.gz.
Most Linux distributions, including Red Hat and Ubuntu, use BASH as the default shell. We will use bash commands in the following steps.
First, create a directory for Maven:
$ mkdir -p /usr/local/apache-maven/apache-maven-3.8.4.
Next, extract the downloaded archive:
$ tar -xvf apache-maven-3.8.4-bin.tar.gz -C /usr/local/apache-maven/apache-maven-3.8.4.
To add Apache Maven to the environment path, open the terminal and edit the .bashrc file with:
$ nano ~/.bashrc.
Add the following lines:
export M2_HOME=/usr/local/apache-maven/apache-maven-3.8.4, export M2=$M2_HOME/bin, export MAVEN_OPTS=-Xms256m -Xmx512m, export PATH=$M2:$PATH.
Save the file and reload the configuration with:
$ source ~/.bashrc.
Finally, check if Maven is installed by running:
$ mvn -version.
You should see output confirming the installation.
To install Apache Maven on Ubuntu, use the command:
$ apt-cache s
search Apache Maven to find available packages, then install it with:
$ sudo apt-get install maven.
Setting Up Apache Maven in Under 5 Minutes
Maven Setup and Project Development
Maven Installation
- Maven is a tool for Java, which necessitates having Java installed.
- To set up Maven, download the package and adhere to the installation guidelines.
- In a terminal or command prompt, enter mvn –version to display the version of Maven that is currently installed.
- If you are on Windows, refer to the Maven Configuration Guide if needed.
Project Creation
- Begin by creating a folder for your project and open a terminal in that location.
- Run the Maven command: mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.5 -DinteractiveMode=false.
- Navigate to the new directory that matches the name specified as the artifactId.
- The project’s layout comprises the pom.xml file, the source code for the project, the test sources, and the Project Object Model (POM) of the project.
Understanding the POM
The pom.xml file serves as the cornerstone of a project’s configuration within Maven.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>17</maven.compiler.release>
<dependencies>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.0</version>
<type>pom</type>
<scope>import</scope>
<dependencies>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
<!-- Optionally: support for parameterized tests -->
<dependency>
<artifactId>junit-jupiter-params</artifactId>
<!-- Specify plugin versions to prevent using Maven defaults (can be transferred to parent pom)
</pluginManagement>
Verifying Your Apache Maven Installation
Apache Maven 3.9.6
Maven home: /opt/maven
Java version: 17.0.9
...
Maven Project Execution and Phases
Creating a Project
- The command archetype: generate creates a new project using a quickstart template.
- A plugin is a group of tasks that serve a similar purpose, like the jboss-maven-plugin.
Building the Project
- When you run the command, it shows different actions and ends with:
- Build Success
- Total time: 2.953 seconds
- Finished at: 2019-11-24T13:05:10+01:00
Package Phase
- The next command is simply “package,” which is a step in the build process.
- The steps that happen include:
- Validate
- Generate-sources
- Process-sources
- Generate-resources
- Process-resources
Compile
To test the compiled and packaged JAR, use the command:
java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
Using Maven Tools
- Common steps in the build process are:
- Validate
- Compile
- Test
- Package
- Integration-test
- Verify
- Install
- Deploy
Other Processes
- Clean: Removes files created from previous builds.
- Site: Makes documentation for the project.
Executing Phases and Goals
- Phases and goals can be run one after the other.
- The command mvn clean dependency:copy-dependencies package will clean the project, copy needed files, and package the project.
Common Errors and Quick Fixes During Installation
You may get the “Mvn not recognized” error.
The PATH to your system is not specified correctly: Check the environment variables once more.
The JAVA_HOME parameter is not set: Choose the JDK installation location as your JAVA_HOME.
Using package management, an outdated version was installed: To get the most recent version, think about installing it manually (Maven 3.9.6 in 2025).
That’s It! You’re Ready to Build With Maven!
This guide made the Apache Maven Download process super simple for you guys. Downloading Apache Maven on Ubuntu/Linux, macOS and Windows will save you hours of time and frustration when building your Java app or managing hundreds of modules in a microservices architecture.
Don’t forget to keep this guide bookmarked for your next big Java Project and you’ll be thanking me later! Good Luck!
FAQs
1. What is the purpose of Apache Maven?
A very powerful build automation tool, Apache Maven is mostly used for Java applications. With a single pom.xml file, developers can manage project builds, dependencies, documentation, and reporting. It is frequently used in large-scale enterprise applications and CI/CD workflows.
2. How can I set up Windows 11 to run Apache Maven?
Install the MAVEN_HOME environment variable after downloading and extracting the most recent Maven ZIP file from the official Apache website. To access Maven’s bin directory from the command line, add it to your system’s PATH.
3. In 2025, what is the most recent version of Apache Maven?
The most recent stable version, Apache Maven 3.9.6, as of 2025, is renowned for its enhanced plugin support, Java 21+ compatibility, and performance.
4. How can I download Apache Maven 3.9.6?
Steps to download Apache Maven 3.9.6: Start by opening your web browser and navigating to the Maven Download Page. Then, click on the link for the binary zip archive of the latest version, which is Maven 3.9.6 in this case. Keep in mind that Maven doesn’t need a traditional installation process.