1. Install jdk, download from the official website http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
The installation directory can be customized, such as: d:\Java\jdk1.8
2. After the installation is complete, find the environment variable, and set JAVA_HOME, PATH (Path), CLASSPATH (ignoring case) in "System Variables".
3、JAVA_HOME=d:\Java\jdk1.8
Add %JAVA_HOME%\bin to Path
%JAVA_HOME%\jre\bin
add to CLASSPATH
.;%JAVA_HOME%\lib\dt.jar
%JAVA_HOME%\lib\tools.jar
Note that to be added separately, only one line is added
test java /javac OK