【发布时间】:2014-10-29 15:19:54
【问题描述】:
我在 Mac 上使用 Eclipse。我想编写一个创建条形图的方法。为此,我需要使用我已下载并添加为外部类文件夹的Bar.java 类。当我在我的方法中引用该类时,它无法识别。我过去在其他课程中遇到过这个问题。
这是我收到的错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Bar cannot be resolved to a type
Bar cannot be resolved to a type
at TaxChart.main(TaxChart.java:5)
Bar.java 位于位于/Desktop/class/ 的文件夹中
我使用 configure build path 和 add external class folder 引用了它。
【问题讨论】:
-
你指向的是 Bar.java 所在的文件夹吗?还是 Bar.class 所在的文件夹? (应该是 Bar.class)
-
..你确实把
Bar.java编译成了Bar.class,对吧? -
对不起,我是java新手,上次出现这个问题时,我在windows机器上试了一下,它马上就工作了。你能更详细地告诉我我做错了什么吗?谢谢!