Bulid Path in Eclipse

What is Build Path?

Build Path is a collection of resource properties contained in the specified Java project.

In a mature Java project, not only the source code written by oneself, but also the system runtime library (JRE), third-party function extension library, other projects in the workspace, and even external class files need to be referenced. All these resources All are depended on by this project, and only after being referenced can the project be compiled successfully, and Build Path is used to configure and manage references to these resources.

Build Path generally includes:

  1. JRE runtime
  2. Third-party function extension library (*.jar format file)
  3. other projects
  4. Other source code or Class files

Why use Build Path?

By using Build Path, you can better manage the resources contained in the Java project and make the project structure clear and reasonable. 
Conversely, as code and functionality increase, the project structure becomes disorganized and difficult to manage.

The specific content in Eclipse is introduced:

Steps to open the Build Path management interface: 
Right-click on the project—>Build Path—>Configure Build Path

write picture description here

Projects option: You can add, edit, and remove projects that the current project depends on.

Libraries option: You can add, edit, and remove library files that the current project depends on. 
Add JARs: is to add the jar files in the current project directory. 
Add External JARs: is to add jar files in external directories outside the current project. 
Add Variable: is to add a variable. 
Add Library: is the library for adding the JRE system. 
Add Class Folder: Add the compiled .class file in the current project. 
Add External Class Folder: Add .class files outside the current project.

Order and Export: You can sort libraries that have been added to the current project, and you can also set whether the library files are also exported with the project when the current project is exported.

Note: 
1. After changing the version of the system library of the project, there will be problems when the higher version is changed to the lower version, and there is no problem in changing the lower version to the higher version. 
Because some packages in the system library of the higher version do not exist in the library of the lower version. Therefore, the adaptability of the system library of the lower version is good. 
write picture description here

2. After changing the version of the system library of the project, if the higher version is changed to a lower version, the compatibility option of JDK should be changed to the current version of JDK. However, if it is a low version to a high version of the system library, there is no problem without changing the compatibility of the JDK. 
Because of JDK compatibility, the JDK version used is associated with the JRE version we selected when we created the project. 
The reason why the system library of the lower version is changed to the higher version does not need to change the JDK compatibility is that the higher version of the JDK is compatible with the lower version. 
write picture description here

 

Reprinted from https://blog.csdn.net/qqqqqq654/article/details/53043742

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325251895&siteId=291194637