import from another java project in eclipse

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