Premise:
1.windows 10 System (not win8, nor Win7)
2. Installing the JDK
Steps
1. Open the Environment Variables window
Right-click this PC (the computer), properties (property), Advanced system settings, Environment Variables (environment variable) ...
2. New Java_home variable
Click New (New) ... Button
Input:
Variable name: java_home
Variable value: The absolute path to the JDK installation on your computer
Click OK when you are finished typing.
You must be able to see the following files under the JDK path.
3. New/Modified CLASSPATH variable
If the CLASSPATH variable is present, check click Edit.
If not, click New (New) ... New.
Enter/Add after the existing variable value:
Variable name: CLASSPATH
Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
Click OK to save.
4. Modifying the PATH variable
Because of the different win10, when the path variable is selected, the system will easily separate all the different paths, and will not be connected like Win7 or win8.
Create a new two path:
%java_home%\bin
%java_home%\jre\bin
5. Check
Open cmd, enter Java, a series of instructions to show that the configuration was successful:
Windows 10 configuration Java environment variables (5 steps)