The meanings of various libraries in MyEclipse

Source: Internet
Author: User
Tags java se

the meanings of various libraries in MyEclipse

JRE System Library,java EE 5 libraries,referenced Libraries These three are the collection names of various jar packages (library files), the names can be arbitrarily taken, but this is the MyEclipse default name. JRE System Library: Refers to a collection of common repository files for Java SE, which is used to build common Java projects;Java EE 5 Libraries: Refers to a collection of common library files for Java EE, and the creation of Web projects uses a collection of library files for this library collection and Java SE;referenced Libraries: Refers to the collection of third-party library files that you use in your project.  If you add the other jar packages required by the project directly to the properties->java Build path->libraries in the project, MyEclipse will automatically categorize the jar packages into a collection and name them referenced Libraries, displayed in the project. referenced libraries is a jar package used in a compiled environment. The so-called jar package used in a compiled environment means that when you write source files in MyEclipse, the classes you need to refer to are obtained from the jar packages in the referenced libraries collection.the jar package in Webroot/web-inf/lib is the jar package used in the runtime environment. A jar package used in the so-called runtime environment is a collection of jar packages that you need to use when running your project.  The jar files in Java are so important that without them we cannot make such an artistic program: encapsulation, modularity, multiplexing, and so on (no ant, Marven way). Today, I'm going to tidy up some of the ways to add management to the jar packages in your project and to solve common problems: 1. Jar is imported into our Web project under Classpath 1) Here, one way is, directly with the MyEclipse in the relevant project jar package, right-click on the Project "MyEclipse" menu, select the corresponding jar package is OK, example "ADD Spring capabilities", And can set some of the spring configuration information, good visual operation; 2) Add the external jar package to the Web project's Lib package, right-click the project "Properties"--"Java Build Path"--"Libraries" tab (of course, under this action, Not just the way to add a jar package); 3) Manually copy the jar file to the project Lib package, the specific operation as long as the jar file to be added to the MyEclipse in the workspace of the Lib package is good; at this point, the jar file is added OK, so easy! Jar files are added, but what is the difference between these types? How to manage it later? Next look at the 2nd.  2, three kinds of jar package to add a way, very OK, then how to choose?  1) In this way, the jar file is directly linked to the MyEclipse file, and is not copied to the Web-inf/lib directory, not for the project publishing, porting, may appear the jar file cannot find the situation.  2) Selective comparison strong, you can add the jar package, as long as you exist on the machine can be, the link is also the absolute path of the jar file, the disadvantage of 1.  3) Directly added to the Web-inf/lib directory, the portability of strong, and strong operability.  In a word, the 3rd kind of jar package import way, personally think is good!  3. Show/Hide jar files in the project different developers have his own habits, and some people think it's too annoying and uncomfortable to show the jar package in the development view. And some people, he would like to look at exactly what technology to use, import which jar package, and by clicking on the jar package in the class file directly view the source code (assuming the previous import source). So, there's a problem with the display and hiding of a jar package: In the Packages Explorer form, there's a drop-down triangle in the upper-right corner, click---"Filters"--"Name filter Patterns (matching names will is hidden) ", under this option, fill in the *.jar, tick the check box to indicate that this type of file is not displayed, multiple types can be", "delimited.  4. In the Java Build Path setting of the Eclipse project, you can add a third-party jar package. However, I found there are several ways to do this, there are "add jars", "Add Externel jars", "Add Library", "Add Classes Loader" and so on, what is the difference between these ways? Add jars means adding jars from your project, provided you have placed the jar in your project directory. The add external jars indicates that the location of the jar requires a URI to locate, and the full path is required. The add Library is a collection of well-defined jars. Because they are often used together, some operations are simplified. For example, when you do RCP development, there will be a plugin library contains the basic plug-ins needed to run the project. Add Classes Loader: Should this be an Add Class folder? This is a meaning to add a jar, which is to tell ClassLoader where to look for class.  5. When a similar java.lang.ClassNotFoundException appears: Org.springframework.web.context.ContextLoaderListener This can not find listener exception, it is important to remember that the Spring jar package must be placed in the project Lib, so as to avoid the occurrence of this error.  add: Although the import package in any way is the same in the local run, but in fact I run, some only Java Build path to function, and some can only be imported into the lib. There is a difference between importing a package with Java Build path and copying the package to Lib, and it doesn't really matter. The Java build path is the package we need to compile, such as when importing ***.***.***, if the Java build path is not used to import the package, the class has a red fork that does not recognize the class, and the import into Lib is the package that the program needs to run. Even if the Java Build path imported packages are not placed under LIB, the classnotfoundexception exception will occur when the project is run.

The meanings of various libraries in MyEclipse

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.