Http://jingyan.baidu.com/article/9f63fb91d87fb0c8400f0e93.html
-
Install the JDK, download it from the Oracel official website, or go to the link via search. Install after download is complete.
-
Install the JDK, and note change the installation directory.
-
After installation, start configuring environment variables, right click on My Computer, click Properties
-
In the dialog box that appears, select Advanced System settings
-
In the dialog box that appears, select the environment variable
-
Create a new variable name named "Classpath" with the variable value ".; %java_home%\lib;%java_home%\lib\tools.jar "(note is the content in" ") copy directly.
-
Create a new variable name named "Java_home", the value of which is the directory where the JDK was previously installed, for example, "E:\Program files\java\jdk1.7.0_40"
-
Add ";%java_home%\bin;%java_home%\jre\bin" to the variable value of the existing system variable "path" (Note that each variable value is separated by ";", the semicolon at the beginning of the variable value is the function) since this configuration is complete.
-
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 is successful.
- 10
At this point, you can write in Notepad, and then call the Java command to compile, run the Java program.
Win7 Configuring Java Environment variables