1. Right-click on the "My Computer" icon and select "Properties"-"advanced"-"environment variables" in the pop-up menu.
2. Create a new system variable in the "System variables" option of the "Environment variable" (Modify the variable if it already has one):
Java_home, the value is: C:\Program files\java\jdk1.7.0 (fill in your JDK path).
The same method builds a system variable (modifies the variable if it already has one):
CLASSPATH, the value is:;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
3, find the variable "PATH" in the system variable, double-click Open, add the following code to the end of the variable value: ";%java_home%\bin;%java_home%\jre\bin;" (Note the first ";" Not less)
When the configuration is complete, start Eclipse, which automatically completes the configuration of the Java environment.
Small bet
The three variables mentioned above have been created here, so the editing interface appears.
The following test is configured successfully, run the cmd command, enter the "java" Command in the dialog box that appears, and if the following results appear, the configuration succeeds:
Detailed new steps can also be referenced: here to write the link content
Java environment variable settings for Eclipse