Issue
I am using a Mac Pro machine and want to install maven. So here is what I am doing. First I download the appropriate .zip. I unzip it and in terminal I type
Theodosioss-MacBook-Pro:~ theo$ export M2_HOME=/Users/theo/apache-
maven-3.5.4
and
Theodosioss-MacBook-Pro:~ theo$ export
PATH=$PATH:/Users/theodosiostziomakas/apache-maven-3.5.4
Then I check if maven is installed but I get this.
mvn --version
-bash: mvn: command not found
How to properly fix this?
Solution
First you need to add maven
path to your PATH
variable correctly,as others have said
export PATH=/YOUR_LOCAL_LOCATION/apache-maven-3.5.4/bin:$PATH
then you need to call source /etc/profile
(pay attention to check the user type,root
or no root
) to make it into effect and then open a new terminal for test
Answered By - lucumt
Answer Checked By - David Goodson (JavaFixing Volunteer)