Installation
Last updated
Was this helpful?
Last updated
Was this helpful?
Apache Maven is a build automation and project management tool primarily used for Java-based projects. This guide provides step-by-step instructions to install Maven on Windows and macOS systems.
Before installing Maven, ensure that the following prerequisites are met:
Maven requires Java JDK 8 or higher.
Ensure Java is installed and properly configured.
To check if Java is installed
Open a terminal or command prompt and run:
This should output the installed Java version.
To check the JDK compiler
If not installed, download and install the JDK from:
Oracle:
OpenJDK:
Ensure the JAVA_HOME
environment variable is set and points to our JDK installation directory.
Download the binary zip archive (for Windows) or tar.gz archive (for macOS/Linux):
Example: apache-maven-3.9.6-bin.zip
or apache-maven-3.9.6-bin.tar.gz
Verify the archive’s checksum (optional but recommended) using the instructions provided on the download page.
Extract the .zip
file to a preferred location, such as:
Open System Properties > Environment Variables, and configure the following:
Add MAVEN_HOME
:
Variable Name: MAVEN_HOME
Variable Value: path to your Maven folder, e.g.:
Add Maven bin
directory to Path
:
Edit the Path
variable and add:
Open a new Command Prompt and run:
We should see Maven version, Java version, and our operating system.
If we have Homebrew installed:
This will automatically handle download, setup, and path configuration.
To verify
Step 1: Extract the Archive
Download and extract the tar.gz
archive:
Step 2: Set Environment Variables
Add the following to your ~/.bash_profile
, ~/.zshrc
, or ~/.bashrc
(depending on your shell):
Apply the changes:
Step 3: Verify Installation
Go to the official Maven download page: