问题描述
我的Eclipse ADT Android / Java工作区中有两个项目 MyProject
MyProjectAutomatedUITests
在MyProject中,有一个包 .constants
code> ButtonNames.java 这是充满常量的
我希望能够使用MyProjectAutomatedUITests
我该怎么做?
您必须将 MyProject
添加到您的 MyProjectAutomatedUITests
通过右键单击项目而不是属性>构建路径>项目>添加
并选择您的项目,通过这样做可以使用 MyProject
的类。
但是,如果你只想要一个类,你应该创建另一个类你的ptoject。
I have two projects in my Eclipse ADT Android/Java workspace
MyProject
MyProjectAutomatedUITests
In MyProject, there is a package .constants
with a class ButtonNames.java
that is full of constants
I want to be able to use the members of that class from MyProjectAutomatedUITests
How can I do that?
You have to add your MyProject
to the build path of your MyProjectAutomatedUITests
by right clicking the project than Properties>Build Path>Projects>Add
and select your project, by doing this you can use the classes of MyProject
.
But if you just want only one class than you should create another one for your ptoject.
这篇关于如何在Eclipse / Java中的同一工作空间中引用另一个项目的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!