Friday, 1 December 2023

Installing Maven

 

Installing Maven

 

On Linux (Ubuntu/Debian)

  1. Install Maven using APT:

bash

sudo apt update

sudo apt install maven

  1. Verify Installation:

bash

mvn -version

Output should display the installed Maven version.

  1. Manual Installation (Optional):

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

  1. Download Maven:
  2. Extract Maven:
    • Extract the archive to a directory (e.g., C:\Program Files\Maven).
  3. 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

  1. Verify Installation: Open a new terminal and run:

bash

 

mvn -version

Output should display the Maven version.


On macOS

  1. Install Maven with Homebrew:

bash

 

brew install maven

  1. Verify Installation:

bash

 

mvn -version

No comments:

Post a Comment