-------------------------------Linux-----------------------------------
JAVA_HOME=/usr/jdk1.8.0_281
export JAVA_HOME
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar
export CLASSPATH
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
export PATH
-------------------------------Windows-----------------------------------
键:JAVA_HOME(新建)
值:C:\Program Files\Java\jdk1.7.0_291
键:ClassPATH(新建)
值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
键:PATH(!在原有的PATH后面进行属性追加下面的值)
值:;%JAVA_HOME%\bin