i'm trying to install maven on my mac first i downloaded apache-maven-3.3.9 and then i entered this code on my bash:
export M2_HOME=$(/usr/local/apache-maven/apache-maven-3.3.9)
and
export PATH=${PATH}:/Users/sabrine/ant/bin:$JAVA_HOME/bin:$ANT_HOME/bin:$M2_HOME/bin:
but it doesn't work i got(i tried with mvn -v)
-bash: mvn: command not found
where is the problem? what should i do?
Don't add
$(
)
around the paths, just use:Followed by yours:
The above assumes that your maven installation is in /usr/local/apache-maven/apache-maven-3.3.9, and
ls -ld /usr/local/apache-maven/apache-maven-3.3.9
gives non-error output.Please follow below steps on terminal
Create bash profile (will be created under home folder and will be hidden file)
Edit bash profile in editor and put next 2 commands in file, save file.
Then check Maven version
If needed please see detailed steps on my blog on How to install Maven on MAC OS?