新增環境變量
export http_proxy=http://127.0.0.1:8080/
刪除環境變量
unset http_proxy
查看環境變量
env
1、首次配置使用“touch .bash_profile” 創建一個.bash_profile的隱藏配置文件
2、已經創建過"open -e .bash_profile"命令打開已經創建的.bash_profile文件
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
PATH=$JAVA_HOME/bin:$PATH:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export JAVA_HOME
export PATH
export CLASSPATH
————————
或者export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
3、使用"source ~/.bash_profile"使配置生效
4、輸入"echo $JAVA_HOME"顯示剛才配置的路徑