BuildPath We only support joining jar file , The specific method is as follows :
stay eclips Right click on the project name ->build path->contigure bud path->java build path There is a

add external jars = Add the package outside the project
add jars = Add project outsourcing
add library = Add a library
add class folder = Add a class folder

The following highlights add library Medium User Libraries
add to User Library, The specific methods are as follows :
1. Right click the project ->build path->Add Libraries...
2. choice User Library->next
3. Click on User Library Button
4. Click on new Button
5. Input Library name( What I want to import is struts 2.1.6 Of jar Bao He jdbc Of jar package , For the convenience of memory , It can be used as Struts 2.1.6 Library)
6. Click on ok
7. Select this user library, And then click add jars
8. To find the corresponding jar package , Just confirm in turn .

User  Liberary Add to Eclipse in , It's just eclipse Enter into force , It's just Eclipse Know where the referenced classes are , But if you want to web The project started normally ,
To tell Tomcat Equal container , Yours jar Where is the bag ( Put it in lib Under the table of contents , The container knows ). So that's what happened , stay eclipse China Canada user library , Just to tune
try , Don't join the user library ,eclipse Can't find import Class , It's going to be red X Number , Don't put JAR Put the bag in lib Next , Capacity cannot find the introduced class , You're going to report a mistake .
add jar and add external jars And add library in User Libraries Is the difference between the :
adopt “add jar” and “add external jars” Added jar Packages are packaged as part of the program into the final program . adopt “User Libraries” Added jar The bag is not .

About Jar package build path The role of :
jar Bags can't be in random places . Whether it's Java Application still Java Web Application .
Java Virtual machine is based on Java ClassLoader( Class loader ) Decide how to , Go there and load Class :
The reason why we put jar bag classPath Next , It's because there is ClassPath ClassLoader
The reason why we can't be here ClassPath Specify some Jar package , But in Java It can also be used in the program .
That's because of ClassPath ClassLoader Is responsible for loading . Such as jrd Under the table of contents jre\lib\*.jar
The reason why we put Jar Put in bags webroot Under the lib Folder , And it can be used in our program , It's the container that implements its own ClassLoader.(Web Middleware server class loading mechanism and sun Provided by the company 3 The default loader is different .)
So can I load Jar, Where to load Jar, It's based on ClassLoader Decisive

Link to the original text :

eclipse in java Project build path Detailed explanation ( Reprint ) More articles about

  1. eclipse in java Project build path Detailed explanation

    BuildPath We only support joining jar file , The specific method is as follows : stay eclips Right click on the project name ->build path->contigure bud path->java build pat ...

  2. Eclipse in Run as --->Maven build Detailed command

    Maven Build  Goals: clean   Clear compilation ,compile   compile ,test   Compile and test ,install Package and send to local warehouse ,package It's just like jar package , It's not going to be sent locally ...

  3. Eclipse Java Build Path Detailed explanation

    Eclipse Java Build Path Detailed explanation 1. Set up "source folder" And "output folder". * source folder: save ...

  4. .gitignore Detailed explanation ( Enclosed eclipse Of java Project .gitignore file )

    Let's talk about today Git A very important document in ――.gitignore. First of all, I want to emphasize a point , The full name of this file is “.gitignore”, Pay attention to the front one “.”. In this way, files without extensions are Windows It's not easy to create , ...

  5. MyEclipse Java Build Path Detailed explanation

    Reprinted from : 1. Set up "source folder&qu ...

  6. modify eclipse in web Project server Deployment path

    and MyEclipse Dissimilarity , stay Eclipse In the do Web By default, the project does not support publishing the project to Web On the server , Will be published to a directory in the workspace , So it can't be started externally Tomcat To run the Web project , Only open Eclipse ...

  7. seek eclipse Medium java build path Detailed explanation

    I also looked for information , But no formal explanation was found , I can only tell you from experience . 1,Source It refers to the path of resources . For example, if the res Before , Resources are placed with src Peer position , Or by /res/*.* To operate the .2,Projec ...

  8. Eclipse Medium build path Detailed explanation

  9. Eclipse in Spring Project XML Profile error Referenced file contains errors

    The project that was running normally , Suddenly applicationContext.xml File header error Sum up the solutions on the Internet : 1. It's possible that the bad network condition leads to If you use Maven Build the project ,spring In the load xsd It's always ...

Random recommendation

  1. Java interview (3)-- Java Relational operator

    class Demo03{ public static void main(String[] args){ // Relational operator == // example 1 int a = 10; int b = 10; double ...

  2. sb Explain (!(~+[])+{})[--[~+""][+[]]*[~+[]] + ~~!+[]]+({}+[])[[~!+[]]*~+[]]

    Code :(!(~+[])+{})[--[~+""][+[]]*[~+[]] + ~~!+[]]+({}+[])[[~!+[]]*~+[]] Output sb. Segment analysis : First analysis s: (! ...

  3. Redis Learning manual ( pipeline )

    One . Request response protocol and RTT: Redis Is a typical based on C/S Model TCP The server . In the process of communication between client and server , It's usually the client that initiates the request first , The server performs the corresponding task after receiving the request , Finally, the obtained data or processing results will be ...

  4. Java RMI Introductory cases

    Java Remote Method Invocation(Java RMI) It's a Java API, Perform remote method calls , amount to Remote Procedure Calls(RPC).Java ...

  5. CCF Soft exam ---《 Interesting numbers 》

    My brain is hot CCF The soft test of software .. But it doesn't seem to have any egg use , Just warm up for the Blue Bridge Cup, and then go to the software institute by the way , Come across an interesting question : time limits : 1s Problem description We call a number interesting , If and only if ...

  6. River Hopscotch( Dichotomous maximum minimum )

    River Hopscotch Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9923   Accepted: 4252 D ...

  7. Message middleware activemq Introduction to the use scenarios of ( combination springboot An example of )

    One . Message queuing overview Message Queuing Middleware is an important component of distributed system , Mainly solve application coupling , Asynchronous messaging , Flow cutting . Achieve high performance , High availability , Scalable and ultimately consistent architecture . It is an indispensable middleware for large distributed system . Currently in production environment , send ...

  8. The first 4 Chapter Package and build - Identity Server 4 Chinese document (v1.0.0)

    IdentityServer By many nuget Package composition . 4.1 IdentityServer4 nuget | github On Including the core IdentityServer The object model , Services and middleware . Only the memory configuration is included ...

  9. Hadoop Learning notes ( Four ):Yarn and MapReduce

    1.  Shut down all firewalls first (master And all slave) 2.  To configure yarn-site.xml file ( Configure all machines , It doesn't start at this time hadoop service ) 3.  Qi Yarn, Enter the command you want start-yarn.s ...

  10. build ssm Steps for

    build SSM Steps for ----------------------------- 1. establish web engineering 2. hold SSM Do everything you need jar Import into project 3.web.xml 1.Springmvc Front end controller for , If ...