jdk download address : http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Select to accept the license agreement, select the corresponding version according to your operating system (take Windows 64-bit as an example), and click Download
Double-click the downloaded JDK to install it. You can choose the default installation path or customize it. Next, the installation is successful.
Then start configuring environment variables
Right click on My Computer -> Properties -> Advanced System Settings -> Environment Variables
Click New under System Variables ( it can also be configured in User Variables, only for the current user, log in with other users, this environment variable will not work, configure it according to your own needs )
Variable name: JAVA_HOME
Variable value: installation path of jdk, for example: C:\Program Files\Java\jdk1.8.0_161 Variable name: classpath
variable:. ;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar
Find the path of the system variable, edit it (must not delete the content under the path), add ; after the variable value and copy the following content
variable name: path
Variable amount:% JAVA_HOME% \ bin;% JAVA_HOME% \ jre \ bin
After the configuration is complete, open cmd (win + R, enter cmd) and enter java -version, as shown in the figure below, indicating that the java operating environment is installed successfully.
Then enter javac on the side
and java
All the content shown in the figure above appears, and the installation and configuration of the JDK is done.