Run : VIM ~/.BASH_PROFILE
TO INSERT NEW ENVIRONEMNT PATH
You can add multiple paths in PATH variable by using : also remember to use /bin in the end of path variable
Once edited this file, tap esc button
Enter :wq to edit this file and quit
To execute this file close all terminal and rerun again else Type source .bash_profile to execute the .bash_profile file.
To verify successful installation enter: echo $PATH. It should display your newly added path. Also, You can type echo $M2_HOME