cd ~
touch .bash_profile
vi .bash_profile
輸入內容jdk變量配置內容:bash
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home #jdk安裝路徑 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
輸入:wq保存。spa
更新配置文件:code
source .bash_profile