Make Sure JAVA_HOME has been setup
Before we configure Maven, we need to make sure JAVA_HOME is setup properly.
1 | echo $JAVA_HOME |
if there is nothing comes out, that means you didn’t set JAVA_HOME up before. You can follow the instructions as follow. If you have configured it correctly, just ignore it.
1 | sudo vi /etc/profile(or ~/.bash_profile or /etc/bashrc) |
Set up Maven
We can download the latest version of maven, then unzip to the installing folder(/usr/local/opt/maven3). Later, we also need to register maven into environment variable files.
1 | sudo vi /etc/profile |