简体   繁体   中英

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

The Classes ADSTool and the Class 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM