error 1:string cannot is resolved to a type
Cause: This is generally because your JDK version is not set up, or the settings are inconsistent.
Solution:
1. First check that the version of Window->preferences->java->compiler and installed JRE is consistent, inconsistent please set it. If also reported is wrong, look at the second step.
2. In the project right-->properties->java Build path->libraries Check that the JRE is consistent with the version of the JRE you set in the first step and should be inconsistent, then delete the original JRE and add Library added in the first step of the library set, click OK can not error ~
Error 2:The import Javax.servlet cannot be resolved
Reason: Developmentservletneed toServlet-api.jarThe package is not added to the appropriate directory (such as the application server's directory,WEBin the applicationWeb-inf/lib) in;This bag isTomcatIt's not in there.JDKamong
Solution:
The lib directory under Tomcat under the common directory has a support for servlet Jar Package Servlet-api.jar , you need to add it in. .
Error 3 :The import Org.apache.catalina cannot be resolved
Solution:
First confirm that the item was added to Tomcat
Project - right click on Properties, select targeted runtimes tick Apache Tomcat then apply
Common errors in importing Web projects into eclipse