linux 添加环境变量

export M2_HOME=/opt/apache-maven-3.8.1
echo export PATH=${PATH}:${M2_HOME}/bin >> /etc/profile
cat /etc/profile

sudo echo 'export PATH=${PATH}:/Volumes/data/jmeter/apache-jmeter-5.4.1/bin' >> /etc/profile
cat /etc/profile
. /etc/profile

 

----------mac

# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc
fi
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:${PATH}
export M2_HOME=/opt/apache-maven-3.8.1
export MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true"
export PATH=${PATH}:${M2_HOME}/bin
export PATH=${PATH}:/Volumes/data/jmeter/apache-jmeter-5.4.1/bin

 ----------linux

export JAVA_HOME=/data/app/jdk1.8.0_311
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

posted @ 2021-06-30 01:35  tonggc1668  阅读(67)  评论(0编辑  收藏  举报