1. Installing the JDK
A. During the installation of the JDK, there are two prompts to select the installation directory, the first time you select the JDK installation directory, and the second time you select the JRE installation directory. It is recommended that you install them separately under the JAVA/JDK and Java/jre folders for management.
B. cannot be installed in a folder (such as the Java folder) root directory, because the JDK and JRE installed in the same folder will be error.
2. JDK environment variable configuration (three steps)
A. Computer → properties → advanced system settings → advanced → environment variables
B. New Java_home variable
Steps:
System variables → new system variables
Variable name: "Java_home"
The value of the variable is the installation directory of the JDK, the main topic is "D:\Java\java1.6\jdk1.6.0_43"
C. Add Path variable
Steps:
System variables → find Path variable → edit
At the end of the variable value, enter "%java_home%\bin;%java_home%\jre\bin;" (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)
D. New Classpath variable
Steps
System variables → new system variables
Variable name: "CLASSPATH"
Variable value: ".; %java_home%\lib;%java_home%\lib\tools.jar "(Note that there is a point in the front)
3. Java Environment Inspection
Run the cmd input java-version (there are spaces between Java and-version)
Java environment variable Configuration