1. Download the jdk on the official website of Sun.

Link address: http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html

 Java installation tutorial (jdk+jre+environment variable configuration)

2. Select the version and system type to download to the local and prepare for installation.
 Java installation tutorial (jdk+jre+environment variable configuration)

3. Open the installation package and click Install.
 Java installation tutorial (jdk+jre+environment variable configuration)
Click Next
 Java installation tutorial (jdk+jre+environment variable configuration) Java installation tutorial (jdk+jre+environment variable configuration) Java installation tutorial (jdk+jre+environment variable configuration)

 Java installation tutorial (jdk+jre+environment variable configuration)
Then the jdk installation is completed, and the next step is the jre installation process. The same method.
 Java installation tutorial (jdk+jre+environment variable configuration) Java installation tutorial (jdk+jre+environment variable configuration) Java installation tutorial (jdk+jre+environment variable configuration)
Wait a moment for the installation to complete
 Java installation tutorial (jdk+jre+environment variable configuration)
Then click Finish. After all the jdk+jre are installed, the most important java environment variables are configured.

(Environment variable configuration)
1. My Computer → Right click Properties → Advanced System Settings → Advanced → Environment Variables
 Java installation tutorial (jdk+jre+environment variable configuration)
 Java installation tutorial (jdk+jre+environment variable configuration)

2: System Variable → New JAVA_HOME Variable
Fill in the installation directory of jdk for variable values (I am D: Java jdk6)
 Java installation tutorial (jdk+jre+environment variable configuration)

3: System variable → Find Path variable → Edit
Enter at the end of the variable value and copy the code in the brackets (% JAVA_HOME% bin;% JAVA_HOME% jre bin;)
(Note whether there is a; sign at the end of the original Path variable value. If there is no; sign, enter the above code first)
 Java installation tutorial (jdk+jre+environment variable configuration)

4: System Variable → New CLASSPATH Variable
Fill in the variable value.;% JAVA_HOME%\lib;% JAVA_HOME%\lib\tools.jar
(Note the first point)
System variable configuration completed
 Java installation tutorial (jdk+jre+environment variable configuration)
**5: Check whether the configuration runs successfully. Enter java - version (there is a space between java and - version)
If the version information is displayed as shown in the figure, the installation and configuration are successful**
 Java installation tutorial (jdk+jre+environment variable configuration)