2022 javaJDK download and installation steps and environment variable configuration [super detailed]

Table of contents

1. JDK download

2. Install JDK

3. Environment variable configuration

4. Test environment variables


        When learning java, you need to install JDK and configure the environment variables before you can learn. The following are the steps to download and install JDK and the configuration of environment variables.

1. JDK download

1. JDK download address:

Java Downloads | Oraclehttps://www.oracle.com/java/technologies/downloads/

 2. Choose this location

3. Slide to the bottom to select the version of JDK you need

4. Then we choose the latest 17 version and click to enter

5. Just choose one of Windows, from top to bottom is the installation file, the bigger one, the smaller installer in the middle, the smallest one is the small installer, which is almost a simplified version of the installer, we choose the most The one in the middle will do, just click to download. You can choose the C drive or other drives.

2. Install JDK

1. After downloading, click to open

2. Then enter this interface

 3. Click Next

 

4. Installing 

 5. Finally, click Close.

3. Environment variable configuration

1. After the installation is complete, configure the environment variables. Right-click the This PC icon on your computer desktop and select Properties.

 

 2. Select Advanced System Settings.

 3. After entering, select the environment variable.

4. Click New. To create two new environment variables, just add a code.

 

 5. The first variable name JAVA_HOME (representing your JDK installation path) is unified, and the variable value corresponds to your JDK installation path. The path can be searched for jdk in the corresponding disk during installation.

 6. The second variable named CLASSPATH can be copied and pasted, and its variable value is also copied and pasted as shown in the figure below:

.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%lib\tools.jar

7. The last one finds a path variable, double-click or click edit.

 8. Add two variable values, click on the blank space to edit. Just copy the following, remember to click OK after editing.

 %JAVA_HOME%\bin

%JAVA_HOME%\jre\bin

 

4. Test environment variables

1. Shortcut key "Windows + R key", enter cmd, click OK.

2. Enter the dos command window and enter the java command, and a bunch of things will pop up, which means the test is successful.

 3. Enter the javac command, and there is also a team of things, which also means success.

 4. Enter the java -version command, as shown in the figure, the test is successful.

 If the above three pictures are available, it means that the java environment variable configuration is successful.

Guess you like

Origin blog.csdn.net/m0_61961937/article/details/122906540