export JAVA_HOME=/usr/local/java
export PATH=$PATH:$JAVA_HOME/bin × PATH放在最前面错误
JAVA_HOME=/usr/local/java
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH × PATH放在最前面错误
JAVA_HOME=/usr/local/java
export JAVA_HOME
PATH="${JAVA_HOME}"/bin:"${PATH}" √
JAVA_HOME=/usr/local/java
export JAVA_HOME
PATH="${JAVA_HOME}"/bin:"${PATH}"
export PATH √
export JAVA_HOME=/usr/local/java
PATH="${JAVA_HOME}"/bin:"${PATH}"
export PATH √
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin:$PATH √
export JAVA_HOME=/usr/local/java
PATH="${PATH}":"${JAVA_HOME}"/bin
export PATH × PATH放在最前面错误
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin
export PATH=$PATH × 提示vi, vim之类的命令找不到程序
export JAVA_HOME=/usr/local/java
export PATH=$PATH
export PATH=$JAVA_HOME/bin × 提示vi, vim之类的命令找不到程序
export JAVA_HOME=/usr/local/resin
export JAVA_HOME=/usr/local/java
export PATH=$JAVA_HOME/bin:$PATH √
export JAVA_HOME=/usr/local/java
export JAVA_HOME=/usr/local/resin
export PATH=$JAVA_HOME/bin:$PATH × 会替换上面的数值
export JAVA_HOME=/usr/local/java
export JAVA_HOME=$JAVA_HOME:/usr/local/resin
export PATH=$JAVA_HOME/bin:$PATH × $xxx, 必须放在最后面
export JAVA_HOME=/usr/local/java
export JAVA_HOME=/usr/local/resin:$JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH √ 正确,$xxx是放在最后面
export JAVA_HOME=/usr/local/java
export JAVA_HOME=.:$JAVA_HOME:/usr/local/resin
export PATH=$JAVA_HOME/bin:$PATH × 加点也不行,必须放在最后面