3 ways to import external jar packages under Eclipse

Using Eclipse to develop applications, the use of third-party jar packages is indispensable, and every time the introduction of jar packages is a big problem, not only the location of those jar packages is often unclear, but also a waste of time. In view of this, I have listed three commonly used jar package introduction methods, the first of which is our most commonly used normal operation method, and the second and third are the express version of the operation method.

    Let's look at the first method: basic step method

    Right-click the project properties, select Property, and select Java Build Path in the list on the left side of the pop-up dialog box, as shown in the following figure: Select Add External JARs, you can select them one by one (you can also select multiple, but they are limited to the same folder) Add a third-party reference jar package.


The operations in the above manner are universal, but every time a project is created, the Jar package needs to be re-introduced, and the Jar package is not reusable.

 

The second way: the user

    right-clicks the project properties of the Jar package, selects Property, selects Java Build Path in the list on the left side of the pop-up dialog box, and the dialog box shown in the above figure pops up. The dialog box is displayed, select "User Library", and then select ->Next
 

 In the dialog box that appears, you can select the user-defined library that has been created, or you can select User Libraries, and select "New" in the new dialog box that pops up to create a new user-defined library.

 In the user-defined library to be created, enter the name of the new custom library, as shown below

      Then for the new library, add the required Jar package

After adding user-defined libraries according to the above steps, these defined User Library libraries can be reused in the future to save time for development.

 

3. The operation mode of the express version: folder import

       In the project, create a new folder (eg: ibatis_jar), as shown in the following figure. In this example, the ibatis_jar folder is created, and the third-party jar package required for project development is copied to this folder.

 

Select the jar package that needs to be added to the project, right-click and select "Build PathàAdd to Build Path", so that the Jar package is successfully imported into the project

 

The three ways to import Jar packages are simpler and more reusable than the second one. When we look for the required Jar packages on different machines, we can just copy these folders directly.

       For the time being, I have these simple understandings of Eclipse importing jar packages. With the accumulation of experience, I will have a deeper understanding of the differences between various ways of Eclipse importing jar packages!

Guess you like

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