After eclipse is imported into the project, a Red Cross is displayed on the project, but there is no file error or syntax error in the project. I cannot explain it, later, I found some documents on the Internet saying that the path of the class library referenced by the project is incorrect. [Project]-> [Right-click]-> [Build path]-> [configure build path]-> [libraries] to view the referenced class library path. It is said on the Internet that the reference error is caused, but the first thing I do during project import is to modify the library here, so this is not the reason.
The error displayed in problems is: Target runtime Apache Tomcat 6.0 is not defined. I checked it online and finally found a solution. In the. settings folder under the project directory, open the org. Eclipse. WST. Common. Project. facet. Core. xml file with the following content:
<? Xmlversion = "1.0" encoding = "UTF-8"?>
<Faceted-Project>
<Runtimename = "Apache Tomcat v6.0"/>
<Fixedfacet = "JST. Web"/>
<Fixedfacet = "JST. Java"/>
<Installedfacet = "JST. Java" version = "6.0"/>
<Installedfacet = "JST. Web" version = "2.5"/>
<Installedfacet = "WST. jsdt. Web" version = "1.0"/>
</Faceted-Project>
Modify it:
<?xml version="1.0" encoding="UTF-8" ?> <faceted-project></faceted-project>
PS: After the above modification, although there is no error, but the "run as"-> "run on server" option is not found when you want to release the website demo. At this time, we create a demo2 web project, and then view org. Eclipse. WST. Common. Project. facet. Core. xml under. settings. The content is:
<?xml version="1.0" encoding="UTF-8" ?> <faceted-project> <runtime name="Apache Tomcat v6.0.29" /> <fixed facet="jst.web" /> <fixed facet="java" /> <fixed facet="wst.jsdt.web" /> <installed facet="java" version="1.6" /> <installed facet="jst.web" version="2.5" /> <installed facet="wst.jsdt.web" version="1.0" /> </faceted-project>
Then we only need to copy the code to the. settings directory under the website demo and overwrite the original org. Eclipse. WST. Common. Project. facet. Core. xml. After overwriting, we can use [run as]-> [run on server] in eclipse to release the demo.