如何使用其他项目的类? [英] How to use classes from another project?
本文介绍了如何使用其他项目的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Eclipse中有两个Java项目。现在我想在项目B中使用项目A中的类。我将项目A添加到项目B的构建路径中。但是项目B中没有类。
I have got two Java projects inside Eclipse. Now I want to use classes from project A in project B. I added project A to the build path of project B. But the classes are not available in project B.
这个问题可能是什么原因?
我做错了吗?
我应该怎么做?
What could be the reason for that problem? Did I do something wrong? What and how should I do?
提前致谢。
更新:问题是要导入的类是在默认包中。
Update: The problem was that the classes to be imported were in the default package.
推荐答案
验证是否在构建属性中在订购和导出选项卡下的项目A中,您已选中源文件夹。
Verify if in the build properties of Project A under the "Order and Export" tab you have the source folder checked.
这篇关于如何使用其他项目的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文