First,
The installation path of the JDK, where we choose to install it by default in the C:\Program files\java\jdk1.7.0_45\ directory.
Second, below,
Set Environment variables:
"1" "My Computer" right-click menu---> Properties---> Advanced---> Environment variables---> System variables---> New
Variable name: java_home
Variable Value: C:\Program files\java\jdk1.7.0_45\
Variable name: Calss_path
Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
"2" Find the PATH variable name---> Edit add:
Variable name: PATH
Variable value:%java_home%\bin;%java_home%\jre\bin;
Third, then,
Verify that Java is successful at the Windows command prompt:
"1" win+r
"2" Run cmd, enter
"3" type Java-version result graph:
"4" type Java, result diagram:
"5" type Javac, result graph:
In the event of an accident:
One of the workarounds:
My Computer Right-click menu---> Properties---> Advanced---> Environment variables---> User variables---> Find path---> Edit
Variable name: Path
Variable value:%java_home%\bin;
Configuration of Java Environment variables