Possibly I am misunderstanding the problem, so I may be asking the wrong question. I am using Mac OSX 10.8.3 and I am creating an applet in eclipse. When I try using import java.* where * is awt, applet, util, etc.
Eclipse shows errors, basically behaving as if it does not recognize the Java libraries. In the preferences I have the Java SE 6 JRE selected. I tried lowering the compiler compliance level to 1.6 but it didn't seem to do anything.
For some of the classes I imported the code was written on a windows machine, but I don't see how that would matter. Any thoughts?
解决方案
Remove the imports, and then Eclipse should detect that the imports you need are not imported. Then press CTRL+SHIFT+O to organize your imports, and Eclipse should automatically retrieve every import you need.
Also, you should never import more than you have to. If import java.* even worked (which it never will), it would be a horrible practice, because then all those libraries have to be loaded into memory (even the ones you don't need). To conserve memory space, avoid using * with imports (Eclipse does this when you organize the imports).