Setting up your development environment for JAVA with Maven — Windows Edition

Hennie Francis
6 min readMar 17, 2024

--

In this blog post, I will walk you through configuring your development machine for JAVA development using Apache Maven on Windows.

By the end of this guide, you will be able to start working on JAVA projects with Apache Maven on Windows.

If you are running macOS or Linux, please see the following posts regarding those Operating Systems:
macOS Edition
Linux Edition

Also see this article for the Hardware Requirements, and Prerequisites:
Setting up your development environment for JAVA with Maven

Software Installation

JetBrains IntelliJ

Download the .exe package and follow the installation wizard instructions
Read the instructions and click Next to continue

Read instructions and click on Next

Verify or Modify the installation path for IntelliJ and click on Next

Verify or Modify the installation path for IntelliJ and click on Next

Specify installation options to your preference. I would recommend selecting all of the Associations and add the PATH variable

Specify installation options and click Next

Choose the Start Menu Folder for IntelliJ and click on Install

Choose the Start Menu Folder for IntelliJ and click on Ins tall

Wait until the software installed successfully

Installation started
Installation Details

Complete the installation by rebooting your machine

Complete the installation by rebooting your machine

JAVA

Open the installer file and the file will start to extract the required files onto the machine

Open file extractor

Read the instructions and click on Next

Read the instructions and click on Next

Verify or Modify the installation path of JAVA and click Next

Verify or Modify the installation path of JAVA and click Next

Installation starting

Installation starting

Updating the components of the installer

Updating the components of the installer

Installer copying files over to machine

Installer copying files over to machine

Installation complete. Click on Close

Installation complete. Click on Close

Set Environment Variables for JAVA by right clicking on the Windows Start Button and navigate to System

Right click on the Windows Start Button and navigate to System

On the right side of your Settings, find the Related settings section and select Advance system settings

On the right side of your Settings, find the Related settings section and select Advance system settings

Ensure you are on the Advanced tab of the window, and navigate to the bottom of the screen and click the Environment Variables button

Click on Environment Variables button

Add a new User Variable for JAVA with the path you installed JAVA to earlier

Add a new User Variable for JAVA with the path you installed JAVA to earlier

Select the Path User Variable for your user and edit the Path record

Select the Path User Variable for your user and edit the Path record

Add a new path record pointing to the bin folder of your JAVA installation, click OK to continue and click OK on the Environment Variables window and click OK and the System Properties window

Add a new path record pointing to the bin folder of your JAVA installation

Apache Maven

To install Maven on Windows 10, ensure JAVA_HOME is set by running the following command

echo %JAVA_HOME%

Verify the above command returns a proper value. If nothing is returned, verify the Java JDK is installed on your system. JDK 21 is needed for the Maven.

Verify the above command returns a proper value. If nothing is returned, verify the Java JDK is installed on your system. JDK 21 is needed for the Maven.

Download the binary zip archive from the publisher’s website
https://maven.apache.org/download.cgi

Download the binary zip archive from the publisher’s website

Extract the archive to a suitable location, I prefer to store all my automation tools in a dedicated directory

Dedicated folder for automation tools

Add the bin directory of the extracted Maven directory to the PATH environment variable.

Set Environment Variables for Maven by right click on the Windows Start Button and navigate to System

Right click on the Windows Start Button and navigate to System

On the right side of your Settings, find the Related settings section and select Advance system settings

On the right side of your Settings, find the Related settings section and select Advance system settings

Ensure you are on the Advanced tab of the window, and navigate to the bottom of the screen and click the Environment Variables button

Click on Environment Variables button

Add a new User Variable for Maven with the path you copied / extracted Maven to earlier

Add a new User Variable for Maven with the path you copied / extracted Maven to earlier

Select the Path User Variable for your user and edit the Path record

Select the Path User Variable for your user and edit the Path record

Add a new path record pointing to the bin folder of your Maven folder, click OK to continue and click OK on the Environment Variables window and click OK and the System Properties window

Software Verification

IntelliJ IDEA

Confirm that IntelliJ IDEA or IntelliJ IDEA Community Edition have entries under the User variables for your user

JAVA

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

java -version
Expected output of JAVA

This command verifies the Java (java) is installed. If java is not found, check your Java installation.

JAVA JDK

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

javac -version
Expected output of JAVA JDK

This command verifies the Java complier (javac) is installed. If javac is not found, check your Java JDK installation.

Maven will not function without JAVA properly installed.

Apache Maven

To verify the Apache Maven is properly installed, from your command line run the following command:

mvn -v

or

mvn -version
Expected Output of Apache Maven

This command verifies Apache Maven is installed. If Maven is not found, check your Maven User Variables

--

--

Hennie Francis

With more than 18 years’ experience in the industry. I believe if you have a passion for tech and a passion for what you do everyday, you will never ''work''