Reputation: 3139
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?
Upvotes: 2
Views: 16492
Reputation: 11
The following works for me. Changes are done to .bash - .profile did not work on my mac
Update the config in ~/.profile
export M2_HOME=<PATH>/apache-maven-X.Y>Z
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
Upvotes: 1
Reputation: 13506
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
Upvotes: 3
Reputation: 190
You have not indicated proper dir, try as below
export PATH=/YOUR_LOCAL_LOCATION/apache-maven-3.5.4/bin:$PATH
Upvotes: 1
Reputation: 307
Try
export PATH=$PATH:/Users/theodosiostziomakas/apache-maven-3.5.4/bin
mvn executable is inside bin folder.
Upvotes: 3