Tuesday, December 8, 2020

How to set M2 path ans install Maven on macOS Catalina v 10.14.XX

 On previous mac Operating systems we just download the Maven and add path to .bash_profile file inside the user path.

That's because when we open a terminal from mac it opens a bash type of terminal as on the below image.



But with the latest macOS bash type terminals are no longer available.

Now we have zsh type of terminals.


There for even you add paths to .bash_profile Maven is not going to work.

So you have to edit .zshrc file inside your users folder.




So locate the .zshrc file or if not create a new file and add below lines to the .zshrc file.(As you normally do with .bash_profile file).

export M2_HOME=/Users/<your profile name>/Documents/Data/apache-maven-3.6.3
export PATH=$PATH:/Users/<your profile name>/Documents/Data/apache-maven-3.6.3/bin