Kaloyan Roussev
Kaloyan Roussev

Reputation: 14711

How can I refer to a class from another project in the same Workspace in Eclipse/Java

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?

Upvotes: 2

Views: 1849

Answers (1)

Akash Thakare
Akash Thakare

Reputation: 22972

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.

Upvotes: 2

Related Questions