To build a Java development environment, quickly learn how to configure JDK environment variables in 5 steps

The first step in learning Java is to master how to quickly build a Java development environment, and the difficulty of the build process is how to configure the JDK environment. Below, Mr. Pan will lead you to select, download, install, environment configuration, and test the JDK version. Steps to demonstrate in detail.

The first step: JDK version selection

At present, the latest version of the JDK is version 14.0.2, but it is best not to use the latest version. The new version may have instability or loopholes, and the key compatibility with other software may also have problems. The basis for the version selection should be the version model used by most companies or enterprise projects on the market, and the current market share should be JDK1.6 and 1.7, and many companies should be transitioning to JDK1.8. There is no doubt that we should choose JDK1.8 to learn.

Step 2: Download JDK1.8

Before downloading, it is recommended to go to the java official website to register an account: click to register, because the download requires you to log in to the system, and you cannot download without logging in, but registration is also very troublesome. You have to fill in a lot of information, so be more patient~

Java SE Development Kit 8u92 installation package official download address: click to go directly, of course, you can also choose other versions, other more versions choose address: other version address

Choose the appropriate installation package according to your computer's operating system. Note that it must be the file starting with jdk, not jre. Jre can only run java programs but cannot develop and compile. Click to download and there will be a pop-up window agreement for you to agree, just check agree, and then you can click to download. If you are not logged in to the system, you still need to register for an account to log in to download.

Step 3: Install JDK

Double-click the downloaded exe file and run it directly to the next step:

Then prompt jdk installation, modify the installation directory to D:\Java\jdk1.8.0_92\, click Next:

Wait patiently for the jdk installation to complete:

Then prompt jre installation, modify the installation directory to D:\Java\jre1.8.0_92\, click Next:

Wait patiently for the jre installation to complete:

Finally, you will be prompted that the installation is complete, click close:

Step 4: Environment variable configuration

Remember that it seems that after jdk1.7, you don't need to configure environment variables, you can use them directly, but it is recommended that you configure it, because if you don't configure it, some unexpected problems may occur. Here take win7 system as an example, win10 system is similar

Right-click the computer on the computer desktop, select properties, and then click Advanced System Settings

Then click on environment variables

Create a new variable named JAVA_HOME in the system variables (the name must be this), and the value is the directory where the jdk was installed just now. Note that it is not the jre directory.

Create a new variable named CLASSPATH in the system variables (the name must be this), and the value is.

Find the variable editor named PATH in the system variables, and add %JAVA_HOME%\bin at the end. Note that it must be separated from the previous content with an English semicolon.

Step 5: Test the Java environment

Open the cmd command box, enter the java -version command, press Enter to run, and the correct version and other information are prompted, indicating that the environment configuration is correct.

to sum up

The establishment of a Java development environment is to master basic skills as a Java programmer, but many people often forget even the most basic skills at the end. Although not commonly used, its significance is self-evident, because there should be no company willing to hire one A Java development engineer who doesn't even know how to configure the environment!

If you are also learning Java now, and you have encountered any questions about learning methods, learning routes, learning efficiency, etc. during the introductory learning of Java, you can come together and communicate at any time: Java technology exchanges gather a lot of learning Java technology For beginners, there are also big guys who are engaged in the development of Java technology. Anything you don’t understand can be asked at any time. The skirt file contains some manuals, interview questions, and development tools that I have compiled during the time I was working on Java technology. PDF document book tutorial, you can download it yourself if you need it.

Guess you like

Origin blog.csdn.net/weixin_46898270/article/details/108360289