Setting up your development environment for JAVA with Maven — Mac Edition
In this blog post, I will walk you through configuring your development machine for JAVA development using Apache Maven on macOS.
By the end of this guide, you will be able to start working on JAVA projects with Apache Maven on macOS.
If you are running Windows or Linux, please see the following posts regarding those Operating Systems:
Windows 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
For macOS you have a few options to install IntelliJ. Installation file must be selected based on your processor (Intel or Apple Silicon).
To identify which option you have, please see this article from Apple:
https://support.apple.com/en-za/116943
Download the file from the website
Using HomeBrew:
Need HomeBrew: https://brew.sh/
Community Edition:
https://formulae.brew.sh/cask/intellij-idea#default
brew install --cask intellij-idea-ce
Ultimate Edition:
https://formulae.brew.sh/cask/intellij-idea#default
brew install --cask intellij-idea
JAVA
For macOS you have a few options to install JAVA. Installation file must be selected based on your processor (Intel or Apple Silicon).
To identify which option you have, please see this article from Apple:
https://support.apple.com/en-za/116943
Download the file from the website
JAVA
Open the installer file and the file will start to extract the required files onto the machine. Read the instructions and select Continue
Verify or Modify the installation path of JAVA and click Continue
Complete the Installation successfully. Click on Close
Apache Maven
Ensure JAVA_HOME is set by running the following command in your terminal
echo %JAVA_HOME%
Download the binary zip archive from the publisher’s website
https://maven.apache.org/download.cgi
Switch to the Maven contents
mv Downloads/apache-maven* /opt/apache-maven
Add Maven binaries to the PATH and append
export PATH=/opt/apache-maven-3.9.6/bin:$PATH
Software Verification
JAVA
To verify the Java JDK is properly installed, from your command line run the following command:
java -version
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
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.
Apache Maven
To verify the Apache Maven is properly installed, from your command line run the following command:
mvn -v
or mvn -version
This command verifies Apache Maven is installed. If Maven is not found, check your Maven User Variables