🚀 Maven Installation Guide

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! 🚀