The premise is that every sub-file in the Eclipse project is correct, but the project name shows a small red fork.
open window, Show View "General ", "problems", to see the problems window prompt error.
My error shows: Target runtime Apache Tomcat v6.0 is not defined.
That's right, because the version of Tomcat I'm using is 7.0, obviously something went wrong.
Open the appropriate project folder under the. Settings folder and edit the Org.eclipse.wst.common.project.facet.core.xml file in it:
<?xml version="1.0"encoding="UTF-8"?><faceted-project> <runtime name="Apache Tomcat v6.0"/> <fixedfacet="Jst.web"/> <fixedfacet="Wst.jsdt.web"/> <fixedfacet="Java"/> <installed facet="Java"version="1.7"/> <installed facet="Jst.web"version="2.5"/> <installed facet="Wst.jsdt.web"version="1.0"/></faceted-project>
Change the version number of Tomcat:
<?xml version="1.0"encoding="UTF-8"?><faceted-project> <runtime name="Apache Tomcat v7.0"/> <fixedfacet="Jst.web"/> <fixedfacet="Wst.jsdt.web"/> <fixedfacet="Java"/> <installed facet="Java"version="1.7"/> <installed facet="Jst.web"version="2.5"/> <installed facet="Wst.jsdt.web"version="1.0"/></faceted-project>
Save.
Refresh the project and solve the problem.
Eclipse project name with small red Fork solution