Download and installation of jdk8 for novices and configuration of path environment variables

Some things are not often used and will always be forgotten, so I want to write them down so that I can find them when I want to use them in the future; At the same time, it also further deepens your memory. I haven't been in contact with Java for a long time. There are some improper words or contents. You are welcome to correct them.

Everyone who studies Java will go through the process of downloading and installing JDK. Take jdk8 as an example:

JDK Download

Where can I download JDK?

There is no doubt that it is on the official website: Oracle com. (this link goes directly to the official website) or search Oracle directly in the browser.

In order to facilitate the majority of learning groups to better learn Java, Oracle company kindly provides all non-commercial users with free versions of JDK for learning. So you don't have to go to the pheasant website to download because you're worried about your wallet - it's very easy to encounter viruses or strange plug-ins; The broad masses of earth eaters can also rush towards their favorite JDK with ease and pleasure!

To find the required JDK version

After entering the official website, the first step is to find Java, as shown in the figure: product display - infrastructure - software

After clicking in, you can see the download Java in the upper right corner

After clicking to enter, there are three versions of JDK officially recommended by Oracle (as shown in the figure), namely, two long-term support versions (LTS): jdk8 and jdk11, and the latest non long-term support version: jdk14 (I was jdk14 when I prepared the screenshot, and now it seems to be jdk15)

The jdk8 I want to install is on this page.

Of course, if you don't find the version you want on the Java se download page, you can pull it to the bottom of the page

Here is a Java archive. Click in

There are all versions of JDK

Select the version I will install - JDK 8u202 and later slide page to find the odd version JDK 8u251

There are different jdks for each system. I use windows here. If you want to know whether your computer is x86 or x64, you can click system and security system directly in the control panel

Mine is x64

Click x64 download and a page will pop up

After agreeing to the license agreement and clicking JDK download here, you will jump to

If you have an account, you can log in directly. If you don't have an account, you can register and log in again

JDK installation

Before installation, you'd better check the path environment variable: right click the desktop on this computer -- > properties -- > advanced system settings -- > environment variable -- > Click path Edit in the system variable to check and confirm

Confirm that there are no other Java items in it. If there are other Java items in it, it may affect the system's choice of java version

Open your download directory, find the development kit you just downloaded, double-click it, it's just an installer of the development kit, and then follow it directly. The only thing that needs to be changed is the installation path of JDK, which is very friendly to Mengxin:

↑ click Next directly

↑ yes, this step is to ask you where you want to install Java. It is suggested to modify its default installation directory and build a special folder where you like to install things about Java - including JDK

be careful! It's best to avoid Chinese characters and spaces in the Java installation directory. It's easy to encounter bugs. Personal experience (crying face)

Click Change... To modify the installation path you want

Click next after modifying the installation path

Note that Java 8 and earlier versions of Java are different from those after Java 8. Java 8 and earlier versions will contain an independent JRE. You will also be asked about its installation path during installation, as follows:

↑ this step is to let you choose the JRE installation path. No doubt, it is still recommended that you do not use its default installation path. It is recommended that you install JRE and JDK in two different folders under the same folder, as follows:

Select the path and press OK

↑ another brainless step

The progress bar ends. When you see this scene ↓, bingo! Congratulations, JDK has been installed, you can rest assured to close.

Configuration of path environment variables

Why configure environment variables?

When I first learned Java, I didn't understand it, but everyone said to configure it. OK, just configure it. Until later

In fact, it is not impossible to use Java without configuring environment variables.

When developing Java, we need to use the development tools provided by JDK, and these tools are in the bin directory under the JDK installation directory. Among them, we will use the tools javac and Java to compile and run the written code. If you do not use environment variables, such as using javac, you only need to enter your JDK installation directory \ jdk8 \ bin \ javac in the DOS command window (Win + R - > Enter CMD - > Enter key). The same is true for using Java. Enter your JDK installation directory \ jdk8 \ bin \ Java in the DOS command window

It's just that it's troublesome to add a long list of directories every time you use it, and editing software such as eclipse (not the self-contained JDK version) and idea can't find your JDK,

Therefore, in order to simplify the operation and use the editing software, the configuration of environment variables is essential.

Configure environment variables

Check again before configuring

The steps to confirm the environment variables are the same as above: right click the computer on the desktop -- > properties -- > advanced system settings -- > environment variables

↑ at this time, sharp eyed people must also find that before installing JDK, we clearly checked that there are no Java items in the system environment variables. What's the matter with Java here?

This is the environment variable that JDK configures in the system environment variable according to its default path during installation. Let's open this path to see ↓

Yes, you are right. There are also Java, javaw and javaws, but only Java, javaw and javaws,

That's why some cute people on the Internet clamor that they can use it without environment variables. It really works, because editing software like idea is automatic Java files are compiled. After compilation, as long as there is Java, it can run. There must be nothing wrong with running.

But don't forget that compared with the complete JDK, there are only three tools under this path... What it means is self-evident.

So delete them mercilessly (including the default environment variables added by the JDK for you). Keeping them also takes up space. There is no need to keep them completely. What do you think? I feel that I have mastered the true meaning of all bugs, so I want to surprise myself occasionally?

(of course, when some cute kids check here again, there is nothing in it. Why? This is closely related to your anti-virus software. The anti-virus software will "see your mood" when you install JDK Decide whether the default environment variable appears in your computer, whether the three things appear under the default address, or both. Therefore, it is recommended to turn off the anti-virus software before installation.)

Topic - configuration of environment variables

After talking so much, I finally got to the point. It's not easy. In fact, configuring environment variables is a simple and cautious operation. The simple thing is that it only needs two steps. Be careful not to lose any characters and the letters are case sensitive.

Don't say much, picture above ↓

yes, First, create a new variable in the system environment variable (click the new one under the system environment variable), and the variable name is java8_home (remember, all letters are capitalized) and the variable value is the installation path of JDK. There are two ways to add the variable value: 1. Click Browse path as shown in the figure. 2. Find the JDK in the folder, copy and paste its file directory, and press OK to finish.

Next is the path environment variable for editing the system variable

Here, we need to create a new variable. After clicking New, fill in the variable value in the blue column:% java8_ HOME%\bin

It is recommended that java8 be added_ The home variable is set to the top, that is, after selecting this variable, click the move up on the right, move to the top, and then press OK. All the way back is OK!

Again, don't miss all the characters, especially%, many people are easy to miss

Detect whether the environment variable configuration is successful

Detection is very simple. Open the DOS command window: Win + R --- > Enter CMD --- > Enter

After entering the DOS command window, enter Java - version. If the configuration is successful, it will display the current JDK version

If the environment variable configuration fails, it will say that Java - version is neither an internal command nor an external command

Similarly, the javac and Java I mentioned earlier can also be used as detection means. After the environment variables are configured, they can be entered directly in the DOS command window without a long list of addresses

The above will appear after successful configuration. Of course, the system language is Chinese, which is a combination of Chinese and English.

Well, the above is the download, installation and configuration of jdk8. You are welcome to point out the deficiencies or lack of details.

Please note the source of reference or forwarding.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>