临时设置
export M2_HOME=/etc/mvn/apache-maven-3.6.1
export PATH={M2_HOME}/bin:{PATH}
当前用户的全局设置
vim ~/.profile
添加行:
export M2_HOME=/etc/mvn/apache-maven-3.6.1
export PATH={M2_HOME}/bin:{PATH}
使生效
source .profile
所有用户的全局设置
vim /etc/profile
在里面加入:
export M2_HOME=/etc/mvn/apache-maven-3.6.1
export PATH={M2_HOME}/bin:{PATH}
使生效
source /etc/profil
感谢分享