windows:
JAVA_HOME: D:\Program Files\Java\jdk1.7.0
PATH: %JAVA_HOME%/bin;%JAVA_HOME%/jre/bin
CLASSPATH: .;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar
验证:
1.“开始”->;“运行”,键入“cmd”;
2.键入命令“java -version”,“java”,“javac”几个命令,出现画面,说明环境变量配置成功。
Linux:
sudo gedit /bashrc
export JAVA_HOME=/opt/jdk1.7.0_01
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH