Download, install and configure JDK17 (detailed tutorial)

1. Search the official website of JDK
https://www.oracle.com/java/technologies/downloads/#jdk17
2. Switch to the window system and switch according to your computer system. Then click download
insert image description here
3. After the download is complete, move the folder you specified and unzip it (here it is placed in the d drive directory)
insert image description here
4. Configure environment variables. Open My Computer -> Click Properties -> Find Advanced System Settings -> Click Environment Variables.
insert image description here
5. Click to create a new variable name "JAVA_HOME", and the variable value is "%JDK-17%". Here you can configure multiple JDK versions for future development needs. If you want to switch the JDK version in the future, you only need to change the variable value of "JAVA_HOME".
insert image description here
insert image description here
6. The new variable name is JDK17, which is consistent with the name of "%%" in the variable value of JAVA_HOME in the previous step. The variable value is "D:\jdk17" (as mentioned in the third step, put the decompressed jdk under jdk17 in the d disk)
insert image description here
7. Click New and enter the variable name "CLASSPATH", and the variable value is ".;% JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib;”
insert image description here
8. Find the Path variable and click Edit, click New and enter “.” in the box, and then click New Hot Enter "%JAVA_HOME%\bin" and click OK.
insert image description here
insert image description here
9. Finally, click OK to save all. Start testing whether JDK17 is successfully installed, open the command window "Win+R" and enter "cmd", in the command window, enter "java" and press Enter, enter "java -version", and press Enter to view
insert image description here
10. If you want to change the JDK version, you only need to repeat the official website to download other versions of JDK, and repeat the steps for JDK17. When finally configuring the environment variable, just change the variable value of JAVA_HOME and add the variable JDK and its variable value (path) in the environment variable. For example, I am testing the 1.8 version of JDK
Add new JDK
insert image description here
11. Finally, after confirming everything, restart the command window to test and repeat the ninth step.
insert image description here

Guess you like

Origin blog.csdn.net/qq_59088934/article/details/128322214