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.