Installing Maven
On Linux (Ubuntu/Debian)
- Install
Maven using APT:
bash
sudo apt update
sudo apt install maven
- Verify
Installation:
bash
mvn -version
Output should display the installed Maven version.
- Manual
Installation (Optional):
- Download
Maven from the Apache Maven Download Page.
- Extract
the archive:
bash
tar -xvzf apache-maven-X.X.X-bin.tar.gz
- Move
it to /opt:
bash
sudo mv apache-maven-X.X.X /opt/maven
- Add
Maven to your PATH:
bash
echo 'export PATH=/opt/maven/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
On Windows
- Download
Maven:
- Visit
the Maven
download page and download the binary .zip file.
- Extract
Maven:
- Extract
the archive to a directory (e.g., C:\Program Files\Maven).
- Set
Environment Variables:
- Go
to Control Panel > System > Advanced System Settings >
Environment Variables.
- Add
a new system variable:
- Name:
MAVEN_HOME
- Value:
C:\Program Files\Maven
- Edit
the Path variable and add:
plaintext
C:\Program Files\Maven\bin
- Verify
Installation: Open a new terminal and run:
bash
mvn -version
Output should display the Maven version.
On macOS
- Install
Maven with Homebrew:
bash
brew install maven
- Verify
Installation:
bash
mvn -version
No comments:
Post a Comment