开发者

Why are my classes not found even though my imports are correct?

The Classes ADSTool and the Cl开发者_JAVA技巧ass PPM are not found by my compiler. I'm using Eclipse Helios. The docs say that I have to import java.lang.Object for both, and I imported java.lang*; I can't see why this isn't working.


The docs say that I have to import java.lang.Object for both, and I imported java.lang*

Any documentation that tells you that you have to import classes in java.lang is blatantly wrong. The classes in java.lang are implicitly imported.


In fact, I suspect that your problem is that you need to add the JAR files containing those two classes (ADSTool and PPM) to the build path of your Eclipse project. If the classes are not available on the build path, the Eclipse compiler won't find them.


check Project->Properties->Java Build Path

did you include JRE System Library in Libraries Tab?


Import java.lang.*, not java.lang*. The second dot matters; without it, the compiler can get confused about what you're actually trying to import.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜