# MAC版本下的批處理文件病附,后綴名為.sh,終端運(yùn)行時(shí)灌危,sh 文件名+后綴
echo $PATH
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk"
export PATH="$JAVA_HOME/Contents/Home/bin:$PATH"
echo $PATH
java HelloWorld
# Windows版本下批處理文件尺栖,而且后綴名為.bat,終端運(yùn)行時(shí)懒叛,直接文件名+后綴就行
# ehco %path%
# set JAVA_HOME="c:Java\JavaVirtualMachines\jdk1.8.0_111.jdk"
# set path=%JAVA_HOME%Contents\Home\bin;%PATH%
# echo %path%
# java HelloWorld