First, preface
the JDK configuration for Win7 and Win8 is basically the same, so this article describes the configuration with Win7 and win10.
Second, WIN7JDK environment configuration (WIN8 and this same)
Install the JDK first, here has installed the JDK7, this article is to take the JDK7 default installation method.
2.1, after the JDK installation is complete, right-click on the Computer-properties, select Advanced System Settings
2.2. Select the "Advanced" tab and click on "Environment variables"
2.3, in "System Variables" Set 3 properties, Java_home,path,classpath (case does not matter), if already exist then click "Edit", do not exist then click "New".
The variable setting parameters are as follows:
- Variable name:java_home
- Variable value:C:\Program Files (x86) \java\jdk1.8.0_91 //To be configured according to your actual path
- Variable name:CLASSPATH
- Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; Remember, there's a "." in front.
- Variable name:Path
- Variable value:%java_home%\bin;%java_home%\jre\bin;
Note: If you use 1.5 the above version of JDK , without setting CLASSPATH environment variables, which can also be compiled and run properly Java program.
2.4. Java_home setting
- Variable name:java_home
- Variable value:C:\Program Files (x86) \java\jdk1.8.0_91 //To be configured according to your actual path
2.5. Path settings
- Variable name:Path
- Variable value:%java_home%\bin;%java_home%\jre\bin;
2.6. Classpath setting
- Variable name:CLASSPATH
- Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; Remember, there's a "." in front.
Third, WIN10JDK environment configuration
Win10 generally can also be configured with the above Win7 method, but some win10 will have problems, that is, the following does not work.
- Variable name:Path
- Variable value:%java_home%\bin;%java_home%\jre\bin;
★ The way to deal with is to use absolute path
First step: Select Path Click Edit
Step Two: Click the browse button in the diagram to find the path to the JDK and JRE
Step three: Click on confirm and then OK
Configuration of Win7, Win8, WIN10JDK