-
New -> variable name "JAVA_HOME", value "C:\Java\jdk1.8.0_05" (that is, the installation path of the JDK)
-
Edit->Variable name "Path", add ";%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin" to the end of the original variable value, win10 remove the semicolon, and just separate the lines
(3) New -> variable name "CLASSPATH", variable value ".;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;"
Note: modified environment Variables, need to reopen a new cmd window! !