1. 输出跟字符串"HOME"匹配的环境变量
  2. $ export | grep HOME
  3. declare -x HOME="/root"
  4. declare -x JAVA_HOME="/usr/java/jdk1.8.0_201-amd64"
# 设置语言环境英文
export LANG=en

配置方式

一般设置用户变量:~/.bash_profile的两种方式

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home
export M2_HOME=/Users/gaox/data/apache-maven-3.6.1
export PY_HOME=/Library/Frameworks/Python.framework/Versions/3.8

PATH=$PATH:$JAVA_HOME/bin
PATH=$PATH:$M2_HOME/bin
PATH=$PATH:$PY_HOME/bin

export PATH
#java environment
export JAVA_HOME=/usr/soft/java/jdk1.8.0_191
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin