Installing Maven

Installing Maven


Apache Maven is distributed in several formats. The simplest way to install Maven is to download a ready-made binary distribution archive and follow the installation instructions. Maven 3.3+ release requires JDK 1.7 or above to execute.

General Requirements

  • Java JDK must be installed on system.
  • Java 1.7 or higher is needed for Maven.

To verify the Java JDK is properly installed, from your command line run the following command:

jt$ javac --version

You should see:

javac 11

This command verifies the Java complier (javac) is installed.

If javac is not found, check your Java JDK installation.

Maven will not function without a properly installed.

Installing Apache Maven on Windows 10

    1. To install Apache Maven on Windows 10, ensure JAVA_HOME is set.
echo %JAVA_HOME%
    1. Download the binary zip archive from a downloaded mirror.
    2. Extract the archive to a suitable location.
    3. Add the bin directory of the extracted Maven directory to the PATH environment variable. The steps to do so on Windows 10 is:
      1. Right-click This PC and select Properties.
      2. On the left pane, select Advance system settings.
      3. Click the Environment Variables button.
      4. In the Environment Variables dialog box that appears, double-click Path under System variables.

Setting PATH as System Variables

      1. In the Edit environment variable dialog box that appears, click the New button.
      2. Add the path to the bin directory of the Maven installation. An example path is C:\apache-maven-3.6.0\bin

Edit Environment Variables Dialog Box

      1. Click the OK button.
      2. Click the OK button to close the Environment Variables dialog box.
      3. Finally, click the OK button to close System Properties.
    1. Open a new command prompt window and type the following command.
mvn -v

This command displays the version information. This also verifies that Maven is installed on your computer.

Installing Apache Maven on POSIX Compliant Operating System (Linux and Mac OS X)

To install Maven on a POSIX Compliant Operating System, such as Linux or Mac OS X

      1. Ensure JAVA_HOME is set.
      1. Download the binary archive from a download mirror.
      2. Switch the Maven contents.
mv Downloads/apache-maven* /opt/apache-maven
      1. Add Maven binaries to the PATH and append.
export PATH=/opt/apache-maven-3.6.0/bin:$PATH
      1. Open a new terminal window and type this command.
mvn -v

This command displays the version information and verifies that Maven is installed on your computer.

About jt

    You May Also Like

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.