Eclipse "cannot be resolved to a type" error

Source: Internet
Author: User
Http://chenxiaohu612.blog.163.com/blog/static/192214286201171004911955/

Http://zhaoningbo.iteye.com/blog/1137215

 

Introduction: 

Newly imported eclipse projects often see the error message "XX cannot be resolved to a type. This article will make a summary.

Body: 

(1) JDK does not match (or does not exist) 

The JDK specified by the project is "jdk1.6.0 _ 18", and currently eclipse uses "jdk1.6.0 _ 22 ". You need to make a simple adjustment in buildpath | libraries.

(2) The jar package is missing or conflicted. 

This error is reported if the jar package where "XX" is not found. To solve this problem, you only need to find the corresponding jar package import Project (CTRL + Click to see the jar package name.

In addition, this error is also reported when the same XX occurs. You may need to transfer the package, unpackage, and delete the package.

(3) Why does eclipse search for a project type policy? 

In eclipse, the above two items have been compared. If there is no problem, you can still report this error. In this case, you need to operate project | clean... to solve the problem. The reason is the mechanism. Eclipse fails to compile automatically for some special reasons.Source codeTo build/classes (or other classes directory), The type cannot be found.

Based on the comments here, I started checking how I cocould make sure that my ant build

Wouldn't interfere with my eclipse build.

I found an option in eclipse that clears up the problem (and is possibly more efficient

Changing the 2 build system's output folders ).

Windows-> preferences-> JAVA-> compiler-> building-> Output Folder->

"Rebuild class files modified by others". This exists in eclipse 3.5; I'm not sure about earlier versions.

Checking this seems to have fixed my problems.

 

Related Article

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.