jdk download (Java8)
(The download time is different, and the minor version number will change, which will not affect subsequent installations)
Official website download address : https://www.oracle.com/java/technologies/downloads/#java8-windows
After downloading, install
JDK environment variable configuration
Win11:
- Right-click My Computer Properties or find the advanced property settings in the settings
- New system variable
variable name input: JAVA_HOME (all uppercase!)
variable value input: drive letter: \jdk installation path
- Create again:
variable name input: CLASSPATH (this is also all uppercase!!)
variable value input: .;%JAVA_HOME% \lib (note that in English format: dot semicolon percent sign JAVA_HOME percent sign backslash lib)
- Select the path point to edit:
- Create a new input %JAVA_HOME%\bin
After completing the previous steps, click "OK" to save
Verify the environment configuration
Win key + R, enter cmd and press Enter key
Input: java Press Enter key to check whether the java operating environment is normal, if the following information appears, the configuration is successful.
Input: javac Press Enter to check whether the java compilation environment is normal. If the following information appears, the configuration is successful.
Enter java -version and press Enter to view the currently installed jdk version.
win10:
a. Create a new JAVA_HOME environment variable, JAVA_HOME=C:\Java\jdk1.8.0_144
b. Modify the path environment variable and add %JAVA_HOME%\bin at the end of the path variable
c. Create a new classpath environment variable, classpath=.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\tools.jar (just like win11, it should be okay without losing so much)
Description: (jdk needs to configure three environment variables; classpath can no longer be set after 1.5, but it is recommended to keep the classpath setting)
WIN10 set JAVA environment variable
Create a new JAVA_HOME environment variable, click "OK"
to find the Path variable, click "Edit"
to add ;%JAVA_HOME%\bin at the end of the path variable, click OK to create
a new classpath variable, set classpath=.;%JAVA_HOME%\lib ;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\tools.jar
Click "OK" continuously to complete the environment variable configuration
verification java and javac command
to open the cmd command line window, enter java, press Enter to execute
the input javac command, enter Execute the car
to get the output of the above java and javac commands, indicating that the jdk installation and configuration are successful