Eclipse Error and resolution "XX cannot is resolved to a type"

Source: Internet
Author: User

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"

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.