(Super detailed) How to download, install and configure JAVA SE Development Kit (JDK) in Windows system

Before introducing the installation method, I will introduce three different versions of JAVA (I personally understand it as three different development directions)

1. Commonly used versions of Java:

分为Java SE、java EE、Java ME三个版本。下面介绍各个版本区别:
  1. Java SE(Java Platform,Standard Edition)

    Java SE was formerly known as J2SE. It allows the development and deployment of Java applications for use in desktop, server, embedded and real-time environments. Java SE is the base package, but also contains classes that support the development of Java Web services and provides the foundation for Java Platform, Enterprise Edition (Java EE).

  2. Java EE(Java Platform,Enterprise Edition)。

    This version was formerly known as J2EE. The Enterprise Edition helps develop and deploy portable, robust, scalable, and secure server-side Java applications. Java EE builds on Java SE and provides Web services, component models, management, and communication APIs that can be used to implement enterprise-class service-oriented architecture (SOA) and Web 2.0 applications.

  3. Java ME(Java Platform,Micro Edition)。

    This version was formerly known as J2ME. Java ME provides a robust and flexible environment for applications running on mobile and embedded devices such as cell phones, PDAs, TV set-top boxes, and printers. Java ME includes a flexible user interface, a robust security model, many built-in network protocols, and rich support for networked and offline applications that can be dynamically downloaded. Applications based on the Java ME specification can be written once for many devices and can take advantage of the native capabilities of each device.

Second, the popular understanding of each version of Java

Java SE is software that runs on computers.
Java EE is for websites. For example: (our common JSP technology)
Java ME is for mobile phone software.
The above content is referenced from: https://www.cnblogs.com/delphixe/p/12907527.html

3. After introducing the differences between the above three versions, let’s introduce the download method of the Java SE Development Kit

Click to enter the official website download address

After entering, this page will be displayed.
insert image description here
Scroll down the page to see the download link of JDK, and choose the version suitable for your windows system (64-bit: X64; 32-bit: X86) to download.Note: Generally speaking, the current computer configuration is generally relatively high. Generally speaking, it is enough to download the 64-bit JDK.
insert image description here
After clicking, check the check box in the pop-up page and click download.
insert image description here
After clicking download, the interface for logging in to the Oracle account will pop up. If you do not have an account, select Register

insert image description here
Mainly through the method of email registration, fill in the relevant information on the registration page to complete the registration.
insert image description here
After filling in the relevant information, click the Create Account button to complete the account creation. After that, Oracle will send a verification email to the email address you filled in. After clicking Confirm, the account creation is completed.
insert image description here
Then return to the previous login interface to log in to the account and the download page will automatically pop up (if the download page does not pop up automatically, it is recommended to use Google Chrome to download)
insert image description here
insert image description here

Fourth, the installation of JDK

Double-click to open the downloaded JDK toolkit

insert image description here

If the following interface pops up, click "Yes"

insert image description here

click next

insert image description here

It is recommended to install the JDK on a disk other than the C disk, and then click Next
Note: Remember the installation directory of JDK here, which will be used in the configuration of environment variables later

insert image description here
JDK starts to install

insert image description here
It is also recommended to install to other disks other than the C drive

insert image description here
start installation

insert image description here
The installation is complete, click Close

insert image description here

5. Configure system environment variables

Right click on This PC and select "Properties"
insert image description here
Click "Advanced System Settings"
insert image description here
Click "Environment Variables"

insert image description here

(1) JAVA_HOME environment variable.

Function: It points to the installation directory of JDK. Software such as Eclipse/NetBeans/Tomcat finds and uses the installed jdk by searching the JAVA_HOME variable.
Configuration method: inClick New in System Variables, fill in JAVA_HOME for the variable name, and fill in the JDK installation path for the variable value. (Fill in according to your own installation path) My installation path is: JAVA_HOME: C:\Program Files\Java\jdk1.8.0_261

Click OK to add successfully

insert image description here
insert image description here

(2) CLASSPATH environment variable.

Function: It is to specify the class search path. To use the already written classes, the premise is of course that they can be found. The JVM uses CLASSPTH to find classes. We need to set the dt.jar and tools.jar in the lib subdirectory under the jdk installation directory to the CLASSPATH. Of course, the current directory "." must also be added to this variable.
Configuration method:
create a new CLASSPATH variable, and the variable value is: .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar. CLASSPATH variable name, can be uppercase or lowercase.Be careful not to forget the dot in front and the semicolon in between. And the semicolon and comma in the state of English input.

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

Click OK to add successfully

insert image description here
insert image description here

(3) path environment variable

Function: Specify the command search path. When executing a command such as javac to compile a java program under the i command line, it will search in the path specified by the PATH variable to see if it can find the corresponding command program. We need to add the bin directory under the jdk installation directory to the existing PATH variable. The bin directory contains frequently used executable files such as javac/java/javadoc, etc. After setting the PATH variable, you can execute javac/java and other tools in any directory.

Find the Path variable in the system variable, which comes with the system and does not need to be created.. Double-click Path, since the original variable value already exists, you should add ";%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin" after the existing variable.Note the preceding semicolon

Path:;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin

Click OK to add successfully

insert image description here
insert image description here
At this point, all the configurations have been completed, and all windows click OK (the window will be closed automatically after clicking OK).

6. Whether the test environment is successfully installed

Check whether the configuration is successful: press and holdwin key + R key(key combination) Enter cmd and press Enter; run cmd and enter java, javac, java -version respectively(space between java and -version)
insert image description here
1.java
insert image description here

2.javac
insert image description here

3.java -version
insert image description here
Note: After entering the above three commands and pressing the Enter key, when the content in the above picture can appear, congratulations! All configuration has been completed.

Guess you like

Origin blog.csdn.net/qq_42455308/article/details/108441066