available to https://www.java.com/zh_CN/download/ Direct Download
First step: Install the JDK file first.
Double click
Enter the installer and click Next
Note : below steps (install to default path) → click Next
Step two: The installation of the JRE file will automatically pop up during the installation process.
(default path can be) Click next → wait for the installation, jump back to the previous installation page → Click Close--Complete the JDK and JRE installation
When the installation is complete, enter java–version on the command line
If the effect in the diagram appears, the installation of the JDK is successful
Step Three: Configure environment variables.
① Find My Computer right click → properties → advanced system settings
(Right click on My Computer icon to select Properties)
Click to enter → select advanced → environment variable Click to enter environment variable menu
② Find system variable (S) → Click New
variable name fill in: Java_home (Locate the path to the JDK file installed in your computer.) )
Variable value fill in: JDK installation directory
as C:\Program Files (x86) \java\jdk1.8.0_101 Click OK.
③ Find the system variable (S) → Look for the Path variable → click edit (or double-click)
Added at the end of the variable value (replicable)
(Locate the Bin directory under the Java file under the installed JDK files in your computer and under the JRE directory under the JDK file.) )
(allows us to invoke commands from two files on the command line anytime, anywhere, without having to find the file before using it)
(Note that the value of the original path is not at the end of the variable, the (English) number, if not, first enter; Enter the following code)
%java_home%\bin;%java_home%\jre\bin;
Click OK
④ Find system variable (S) → Click New
Variable name fill in: CLASSPATH variable
Variable value filling (replicable)
(found in the JDK directory in the Lib directory, Sun has written to provide users with the class library, and found in the JDK directory Lib Tools.jar, it is a tool class library, compile and run the need to use.) )
(Note the first point, which represents the current working directory of the Java Virtual Runtime (the path to the written. Java source file))
.; %java_home%\lib;%java_home%\lib\tools.jar
Click OK
Finally click OK to exit the Setup to complete the configuration.
After the configuration is complete, enter Java on the command line
After completing the above, enter JAVAC in the command line
If the effect in the diagram appears, the installation of the JDK is successful
Java Environment Configuration