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.