JDK installation and environment variable configuration (Win10 detailed version)

foreword

Why write this article, because I don't want to go to Baidu to search for other people's articles, so I write one for my own records.

1. Preparation

JDK8 download address

insert image description here

 JDK8 download address 2

 

Because some readers said that Oracle needs an account to download, and you don’t want to go to the trouble of registering one, then you can download it through the download address 2, and you can download it directly with 0 points.

A JDK installer, this is version 1.8, because the new JDK version does not have any great highlights, as shown in the figure below,

insert image description here

2. Installation

Double-click the mouse to run,

insert image description here

Select "Yes", and then as shown below:

insert image description here 

Click Next:

insert image description here 

I do not modify the installation path of JDK here, so there is no need to change it, click Next:

insert image description here 

During the installation process, a jre installation prompt box will pop up, as shown below:

 insert image description here

No changes here, click next, and you'll see this:

insert image description here 

Anyway, you are boring, why not talk about the meaning of this picture, Java has become the driver of 300 million people, Java belongs to the ORACLE company, friends who are in the background here should be more clear, and the new features of Java8 also make the replacement of JDK behind Java change. 90% of developers still choose Java8, and no one cares about the latest Java14, mainly because of the stability of Java8. Another point is that the JDK after Java may not be open source, which means that no matter what they do in the future, people who use the previous Java version will be generalized. At this time, the old fox Google is very cunning , use the new language, so the preferred language of the Android Studio compiler will become Kotlin instead of Java, which can be regarded as a rainy day. You should have installed it after reading these.

insert image description here 

In this way, the installation is complete, click "Close", and then configure the environment variables.

3. Configure environment variables

Right-click "This PC" and select Properties, then a pop-up window will appear, click "Advanced System Settings"

 insert image description here

As shown below:

insert image description here 

Click "Environment Variables" and you will see a screen like this:
insert image description here 

The key is the following content, user variables can be ignored:

insert image description here 

So far you have completed all the preparation steps, the next step is to configure the environment:
1. Click "New" and a pop-up window will appear:

insert image description here 

Variable name: JAVA_HOME
variable value: C:\Program Files\Java\jdk1.8.0_162 (JDK installation path, here is your own installation path)

insert image description here 

After the input is complete, click Confirm, the first configuration is completed, and then proceed to the second step


2. Create a new CLASSPATH  variable, the variable value is:
.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar ( note that there is a dot in front ), after configuration is as shown below, here can be copied and pasted. 

![Insert picture description here](https://img-blog.csdnimg.cn/20200324145920366.png

Then click OK to save the variable and go to the third step

3. Configure the path , find the path, double-click or click edit

insert image description here

Then you can see that there are already a lot of content in the path, we create a new one at the end:

insert image description here 

Enter separately

%JAVA_CLASS%\bin

%JAVA_HOME%\bin

insert image description here 

 Then click OK to save, and then click OK after you go out, and then click OK, so far the environment variable configuration is complete, and the next step is to test whether there is any problem with the environment variable configuration.

Fourth, check the environment variable configuration

1. win + r Or search in the search bar运行

2. Enter  cmd and click OK

insert image description here

 Enter  javac whether the environment variable is configured successfully

insert image description here

Enter  java -version to view the version number
insert image description here

Even if the above page appears, the installation is successful

6. If unsuccessful

%JAVA_CLASS%\bin
%JAVA_HOME%\bin Delete and replace
the newly configured environment variable pathwith the above two values ​​and try to execute the command.记住要重新开一个cmd

Guess you like

Origin blog.csdn.net/qq_62291388/article/details/130301332