๐Ÿš€ Maven Installation Guide

Michael JAYEOLAMichael JAYEOLA
2 min read

Setting up Maven can seem a bit daunting at first, but with this step-by-step guide, you'll have it running in no time! Let's get started. ๐Ÿ”ฅ

1๏ธโƒฃ Download and Install Java Software

Before installing Maven, you need Java installed on your system. When you install Java, you'll get two key components:

  • JDK (Java Development Kit) ๐Ÿ› ๏ธ: Contains tools for developing Java programs.

  • JRE (Java Runtime Environment) ๐ŸŒ: Provides the runtime environment to execute Java programs.

๐Ÿ‘‰ Download Java Here


2๏ธโƒฃ Set JAVA_HOME in Environment Variables

Environment variables ensure Java is recognized system-wide.

Types of Environment Variables:

  • User Environment Variable: Specific to the currently logged-in account.

  • System Environment Variable: Applies to all user accounts on the machine.

Steps to Set JAVA_HOME:

  1. Open System Properties (Right-click on "This PC" > Properties > Advanced system settings).

  2. Go to Environment Variables.

  3. Under System Variables, click New.

  4. Add:

    • Variable Name: JAVA_HOME

    • Variable Value: C:\Program Files\Java\jdk1.8.0_202

โš ๏ธ Note:

Environment variables are crucial for enabling the operating system to locate Java binaries.

3๏ธโƒฃ Add Java to System Path

  1. In Environment Variables, locate the Path variable under System Variables.

  2. Click Edit and add the following:

     C:\Program Files\Java\jdk1.8.0_202\bin
    

4๏ธโƒฃ Verify Java Installation โœ…

Open Command Prompt and run the following command:

java -version

5๏ธโƒฃ Download Maven Software ๐Ÿ“ฆ

Get Maven from the official Apache Maven website.

๐Ÿ‘‰ Download Maven Here

File Name: apache-maven-3.8.5-bin.zip

6๏ธโƒฃ Extract and Place Maven

  1. Extract the downloaded Maven ZIP file.

  2. Copy the extracted Maven folder.

  3. Paste it into your C: drive:

     C:\apache-maven-3.8.5
    

7๏ธโƒฃ Set MAVEN_HOME in System Environment Variables

  1. Open Environment Variables (as described earlier).

  2. Add a new System Variable:

    • Variable Name: MAVEN_HOME

    • Variable Value: C:\apache-maven-3.8.5

8๏ธโƒฃ Add Maven to System Path

  1. Edit the Path variable under System Variables.

Add the following:

C:\apache-maven-3.8.5\bin

9๏ธโƒฃ Verify Maven Installation โœ…

Open Command Prompt and run the following command:

mvn -v

If Maven is installed correctly, you should see output similar to this:

๐ŸŽ‰ Congratulations! Maven is now installed and ready to use.

๐Ÿ’ก Pro Tip: Keep both Java and Maven updated to their latest stable versions for the best performance and compatibility.

Happy coding! ๐Ÿš€

11
Subscribe to my newsletter

Read articles from Michael JAYEOLA directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Michael JAYEOLA
Michael JAYEOLA