Eclipse error—— “xxx cannot be resolved to a type”

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

    The jdk specified by the project is "jdk1.6.0_18", while the current eclipse uses "jdk1.6.0_22". You need to make simple adjustments in BuildPath | Libraries.

    (2) Missing or conflicting jar package

    This error will be reported when the jar package where "XX" is not found. The solution only needs to find (ctrl+click, you may see the jar package name) the corresponding jar package import project.

    In addition, this error will also be reported when the same XX appears. It may be necessary to repack, unpack, and delete.

    (3) eclipse finds project type strategy

    Under eclipse, the above two have been compared, there is no problem, but this error was reported. At this time, you need to operate Project | Clean... to solve the problem. The reason is due to the mechanism. For some special reasons, eclipse failed to automatically compile the source code to build/classes (or other classes directory), resulting in the type not being found.




Guess you like

Origin blog.csdn.net/junzhu_beautifulpig/article/details/49977403