需要设置:
JAVA_HOME="..."
新建CLASSPATH=".;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;"
PATH中加入JDK和JRE的Bin目录:%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
这三个配置完基本就OK了,在CMD里验证java -version:
C:\Users\XXXX>java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)