1. JDK installation Java environment variable configuration

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
insert image description here
After downloading, install

JDK environment variable configuration

Win11:

  1. Right-click My Computer Properties or find the advanced property settings in the settings
    insert image description here
    insert image description here
    insert image description here
  2. New system variable
    variable name input: JAVA_HOME (all uppercase!)
    variable value input: drive letter: \jdk installation path
    insert image description here
  3. 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)
    insert image description here
  4. Select the path point to edit:
    insert image description here
  5. Create a new input %JAVA_HOME%\bin
    insert image description here
    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.
insert image description here
Input: javac Press Enter to check whether the java compilation environment is normal. If the following information appears, the configuration is successful.
insert image description here
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
insert image description here
insert image description here
insert image description here
insert image description here
Create a new JAVA_HOME environment variable, click "OK"
insert image description here
to find the Path variable, click "Edit"
insert image description here
to add ;%JAVA_HOME%\bin at the end of the path variable, click OK to create
insert image description here
a new classpath variable, set classpath=.;%JAVA_HOME%\lib ;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\tools.jar
insert image description here
Click "OK" continuously to complete the environment variable configuration
insert image description here
verification java and javac command
   to open the cmd command line window, enter java, press Enter to execute
insert image description here
the input javac command, enter Execute the car
insert image description here
to get the output of the above java and javac commands, indicating that the jdk installation and configuration are successful

Guess you like

Origin blog.csdn.net/JemeryShen/article/details/129444142