What's the difference between putting the jar package under project Lib under Eclipse and loading it through BuildPath (to resolve an intermediate method that cannot find the class)

Source: Internet
Author: User
I import the jar into eclipse through the User libranry of Eclipse, compile no problem, run when the class file is not defined, and later on the online search, the reason to find, is this:

with the Java build path to import the package and copy the package to the Lib there is a difference , it does not conflict, it does not matter, the Java build path is the package we need to compile, such as in the import ***.***.*** If you do not use the Java Build Path import package, there is a red fork in the class, saying that the class is not recognized;

Import to Lib is the package that the program needs to run, even if the package imported by Java Build Path is not put into Lib, the classnotfoundexception exception will occur when running the project.

1, first copy the jar package to the project Lib directory

2. Then refresh with F5 in Eclipse to see the newly added jar package from Lib

3, finally add the jar inside the BuildPath, note that the path must be local "/". /..."

What's the difference between putting the jar package under project Lib under Eclipse and loading it through BuildPath (to resolve an intermediate method that cannot find the class)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.