Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mvn: command not found - terminal

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?

like image 860
Theo Avatar asked Feb 13 '26 03:02

Theo


2 Answers

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

like image 159
lucumt Avatar answered Feb 15 '26 16:02

lucumt


Try

export PATH=$PATH:/Users/theodosiostziomakas/apache-maven-3.5.4/bin

mvn executable is inside bin folder.

like image 42
Pablo Avatar answered Feb 15 '26 15:02

Pablo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!