80

I'm working on two projects in eclipse and I would like to import some classes from project a to project b. What should I do?

Is there a way of doing it without adding the project to the build path ?

2
  • can you clarify how to import class from another project ? I'm getting error The import can not be resolved Commented May 22, 2017 at 14:42
  • Found the problem; I didn't specify any package for class in the project which I had included under Projects. Found this issue through stackoverflow.com/questions/2335211/… Commented May 22, 2017 at 15:39

1 Answer 1

103

add project A to project B's build path.

Follow these steps:
Edits by @David B
Right click on project B's folder in eclipse --> properties --> build path --> projects --> add.
Now add project A

Sign up to request clarification or add additional context in comments.

9 Comments

thanks! just to be more explicit for future reference of other readers: right click on project b's folder in eclipse --> properties --> build path --> projects --> add.
i followed your solution and i got a cycle was detected in the build path.
By Build Path do you mean Java Build Path?
There's some trouble following ozk solution but David B is much better.
@bouncingHippo I think that mean you have both files importing each other.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.