Common errors in importing Web projects into eclipse

Source: Internet
Author: User
Tags apache tomcat

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

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.