Scenario: When a project is developed, a project refers to a file in another project, with an error "XX cannot be resolved to a type", but in the actual tracking "F3" can find the corresponding file, finally solved with method 4.
Introduction:
Eclipse's newly imported project often sees "XX cannot is resolved to a type" error message. This article will be done with a simple summary.
Text:
1 JDK does not match (or does not exist)
The JDK specified by the project is "jdk1.6.0_18", while current eclipse is using "jdk1.6.0_22". Need to be in BuildPath | Libraries, make simple adjustments in.
2 missing or conflicting jar packages
This error is reported when the jar containing the "XX" is not found. Resolve only need to find (CTRL + click, may see the jar package name) corresponding to the Jar package import project.
In addition, this error will also be reported when the same xx appears. You may need to swap, unpack, or delete.
3 Eclipse Lookup Project type policy caused
Eclipse, the above two have been compared, there is no problem, but also reported this mistake. At this point, you need to work on Project | Clean ..., the problem can be solved. The reason is that the mechanism is responsible. For some special reasons, Eclipse failed to automatically compile the source code into build/classes (or other classes directories), causing the type to not be found.
4 other
Based on the comments here, I started checking how I could 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 are possibly more efficient than
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 has the fixed my problems.
(EXT) Eclipse Error and resolution "XX cannot be resolved to a type"