First, download the latest version of the JDK. You can go to http://java.sun.com/javase/downloads/index.jsp to download the latest version of JDK1.6. I installed "C:\Program files\java\jdk1.6.0_10" (Take this as an example).
Second, after the installation of the configuration. Right click on "My Computer", open "Properties", select "Advanced" Inside "environment variable". The system variable needs to be set to three properties in the newly opened interface. The path attribute exists on a computer that does not have a JDK installed.
1) in the "User variable" click on "New", then the variable name is written "Java_home", the variable value is written on the installation path just now "c:\program files\java\jdk1.6.0_10 ".
2) Locate the path in the system variable and click Edit. The meaning of path is that the system can recognize Java commands under any path. Add variable Value "; c:\program files\java\jdk1.6.0_10 \ Bin c:\program files\java\jdk1.6.0_10 \ Jre\bin ". (Note: The red part is based on its own installation address; The front number cannot be less)
3) In the system variable, click "New", then the variable name "Classpath", the meaning of the variable is the Java load class (Bin or lib) path, only the class in Classpath, the Java command can be recognized. The value is "c:\program files\java\jdk1.6.0_10 \lib\dt.jar; c:\program files\java\jdk1.6.0_10 \ Lib\tools.jar "(Note: The red part is based on your installation address).
Third, verify whether the installation is successful. Click "Start", "Run", enter "cmd", enter the command line interface, into "java-version", if the installation is successful, The system displays the Java version "1.6.0_10" ..... (different version numbers are different)
Configuring Java Environment variables