Andrew Boro
Published in

Andrew Boro

Install Maven on MacOS

Photo by Dan Counsell on Unsplash

Firstly, fix the “Operation not permitted” issue.

Go to System Preferences -> Privacy -> Full Disk Access -> click the lock to make changes -> provide user credentials -> click on the “+” sign -> select Terminal -> Open

Download and save Maven to an installation directory.

I like to have a folder dedicated to development on my machine.

Open the Terminal.

sudo mkdir /Users/<username>/dev

Download Maven from the official site.

Save the apache-maven-<version>-bin.tar.gz file to /Users/<username>/dev

Extract the archive by either right clicking with your mouse or using Ctrl + Tap with the Trackpad and choose Open from the context menu.

Configure MacOS so that you can use the “mvn” command.

sudo mkdir /usr/local/bin/sudo ln -s /Users/<username>/dev/apache-maven-3.6.3/bin/mvn /usr/local/bin/mvn

Verify it works.

mvn -version



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store