-
Notifications
You must be signed in to change notification settings - Fork 1
Install Maven ‐ Window
Simon Sai edited this page Sep 18, 2024
·
2 revisions
- Visit the Apache Maven download page:
- Open your browser and go to the official Apache Maven download page: Apache Maven Downloads.
- Download the Binary ZIP archive:
- Under the "Files" section, look for the Binary zip archive and click on the corresponding link to download the
.zip
file. This file contains Maven’s binaries.
- Extract the ZIP file:
- Once the download is complete, locate the downloaded
.zip
file (usually in your Downloads folder). - Right-click on the file and select Extract All..., then choose a location where you want to extract Maven (e.g.,
C:\Program Files\Apache\Maven
).
- Move the extracted folder (if necessary):
- After extraction, you will have a folder named something like apache-maven-3.x.x. Move this folder to a permanent location (e.g.,
C:\Program Files\Apache\Maven
).
To run Maven from the command line, you need to set up the MAVEN_HOME environment variable and add Maven to the system's PATH.
- Open Environment Variables settings:
- Right-click on the This PC icon on your desktop or in File Explorer, and select Properties.
- On the left sidebar, click Advanced system settings.
- In the System Properties window, click the Environment Variables... button at the bottom.
- Create the
MAVEN_HOME
variable:
- Under System variables, click New....
- For Variable name, enter
MAVEN_HOME
. - For Variable value, enter the path to the extracted Maven folder (e.g.,
C:\Program Files\Apache\Maven\apache-maven-3.x.x
). - Click OK to save the variable.
- Add Maven to the
PATH
variable:
- In the System variables section, find the Path variable, select it, and click Edit.
- In the Edit Environment Variable window, click New and add the following path:
%MAVEN_HOME%\bin
- Click OK to save the changes.
- Open Command Prompt:
- Press
Windows + R
, typecmd
, and press Enter to open the Command Prompt.
- Verify the Maven installation:
- In the Command Prompt window, type the following command to check if Maven was installed correctly:
mvn -v
- Check the output:
- If Maven is installed correctly, you should see output displaying the Maven version, the Java version, and other relevant system information. Example:
You have now installed Apache Maven and configured it on your system. Enjoy building your Java projects!