Location>code7788 >text

Java Learning Notes 2 - JDK installation and configuration

Popularity:564 ℃/2024-08-12 09:02:44

I. Go to the oracle website and download the jdk
oracle official website:Oracle | Cloud Applications and Cloud Platform

ps: different browsers, may enter the oracle official website, will only display part of the content, so it is recommended to use Google Chrome browser!

img

img

img

img

Before downloading, you first need to go to view the configuration model of the local computer, as shown below, right-click --- this computer --- choose to click on Properties, showing the x64 version as follows

img

I'm going to download the latest version of jdk here, jdk20.

img

img

img

I chose to put it in the D drive directory

img

Selected a good D disk directory under the file, and then click OK --- Next, until the download is complete!

img

After the completion of the download to the specified folder to unzip (this article choose to put in D:\jdk20)

img

II. Configuration jdk development environment
Configure environment variables for JDK, right click this computer ---- properties ---- Advanced System Settings ->Environment Variables (this post is for win10 as an example)

existimgCreate a new directory in the system variables as shown

img

Create JAVA_HOME (named "JAVA_HOME", which corresponds to the value written in the directory of the jdk installed on your computer) - click on Confirmation

img

Click to create a new system variable named "CLASSPATH" with a value of "

.;%JAVA_HOME%\lib\;%JAVA_HOME%\lib\;%JAVA_HOME%\lib;

"

Click OK after successful setup

img

Find the Path variable in System Variables and click on it to edit it.

img

Click New and enter "%JAVA_HOME%\bin", move it up to the top and save it (as follows).

img

img

III. Test Installation Success
Begin to test whether JDK20 installed successfully, use the shortcut command "Win + R" enter "cmd" to open the command window, type "java", click enter, type "java -version", click enter JDK20 version of the information appears to indicate that the JDK has been successfully installed, as follows:

img

img

ps: In summary, type Java -version If the Java version information appears, the jdk installation is successful!