Learn about the new Java development environment configuration

First the clichéd steps:

1. Download and install JDK

JDK official website download address: https://www.oracle.com/java/technologies/javase-downloads.html

Baidu cloud disk download address to prevent slow network speed and no Oracle account: https://pan.baidu.com/s/1CKgrwq3y-etwyl2U6_BYrg

Extraction code: qxf2

 

2. Environment variable configuration:

1.JAVA_HOME: D:\Java\jdk\jdk1.8.0_221 (that is, the jdk installation directory)

2.PATH:%JAVA_HOME%\bin

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

 

So why configure these? In fact, the most useful configuration is PATH, which is used to add Java-related executable file paths. What is it used for? That is to say, if you configure PATH, you can execute java commands in any directory. If not, you can only execute java commands in the jdk installation directory.

JAVA_HOME is just an alias here. If JAVA_HOME is not configured, the above PATH should be changed to: D:\Java\jdk\jdk1.8.0_221\bin. The JAVA_HOME variable is added for convenience when modifying the jdk installation path. After all, path It is not convenient to find a big pile in it.

Configuring CLASSPATH is to instruct the jvm to search for the required .class files. The dt.jar configured here is the class library for the running environment, tools.jar is the tool class library, and the "." in front represents the current directory.

Guess you like

Origin blog.csdn.net/rice2020/article/details/115178854