Introduction to the. classpath file generated by ECLIPSE

Source: Internet
Author: User

1 ,. the classpath file is a file generated when eclipse creates a WEB Project (under the project directory). It changes the Java build path or the jar package loading sequence, this file will also change.

2. The classpath file cannot be deleted at will. When I import an existing project into the eclipse work zone. after the classpath file is deleted and the jar package is re-imported, the entire project will be re-compiled and generated. classpath file, but this is re-generated. the content of the classpath file may cause problems, which may lead to unexpected problems during Tomcat deployment.
For example:
The main content of the original. classpath file is as follows:
<Classpathentry kind = "src" Path = "src"/>
<Classpathentry kind = "con" Path = "org. Eclipse. jdt. Launching. jre_container"/>
<Classpathentry kind = "output" Path = "webroot/WEB-INF/classes"/>

After an individual deletes the file, the main content of the. classpath file re-built by eclipse is as follows:
<Classpathentry kind = "src" Path = ""/>
<Classpathentry kind = "con" Path = "org. eclipse. jdt. launching. jre_container/org. eclipse. jdt. internal. debug. UI. launcher. standardvmtype/jdk1.6.0 _ 11 "/>
<Classpathentry kind = "output" Path = "/bin"/>
Note: <classpathentry kind = "src" Path = "src"/> indicates the address of the project source file;
<Classpathentry kind = "output" Path = "/bin"/> indicates the address of the generated class file;

Before and After comparison. the classpath file can be found and re-built. the source file address in the classpath file is <classpathentry kind = "src" Path = ""/>. In this way, all package errors will occur throughout the project, in this case, eclipse is package src.com by default. test, and the correct package name in the project should be package COM. test

In addition, if the generated. the class file address of the classpath file is in the bin directory, that is, <classpathentry kind = "output" Path = "/bin"/>, default to webroot/WEN-INF/classes this directory to find the class file, and at this time the class file does not exist in the bin directory, so there is no class file under tomcat, will generate classnotfoundexception error at startup!

If you encounter the above problems, you can refer to the original. classpath file to modify it.

I have never paid attention to the. classpath file before. This time, I have a deep understanding of it, and it takes a lot of time to complete it. The reason for this is that I deleted the. classpath file easily.

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.