First, the installation of the JDK
Two installation prompts appear during installation: the first is to install the JDK, the second is to install the JRE, and two is recommended to be installed in a different folder in the same Java folder.
Second, configure environment variables
Computer → properties → advanced system settings → advanced → environment variables:
1) System Variable-----new java_home variable;
Variable value fill in the JDK installation directory (I am D:\Program Files (x86) \java\jdk1.7.0_45)
2) system variables → find Path variable → edit
Enter%java_home%\bin;%java_home%\jre\bin at the end of the variable value;
(Note that the original path of the variable value at the end of there is no; number, if not, first enter; number and then enter the above code)
3) system variables → new CLASSPATH variable
Variable values are filled in.; %java_home%\lib;%java_home%\lib\tools.jar (Note that there is a point in the front)
System Variable Configuration complete
4) Verify that the configuration is running successfully cmd input java-version (there are spaces between Java and-version)
Displaying version information indicates that the installation and configuration were successful.
Three, the System variable interpretation:
Path: the route to be searched for when executing commands for the Windows system;
Classpath: The path of the class where Java is to be found when compiling and running;
Java Learning---Configuration of JDK installation and environment variables