Reputation: 141
I am trying to import a package from one project in eclipse to another. Both projects are found in the same eclipse workarea. The problem is I cannot seem to be able to import any package (activity in a package). I browsed through a lot of threads here but could not find an answer. Should I somehow register these packages before they could be imported?
Thank you. Avi
Update: Adding the project to the java build path did the trick.
Thanks again. Avi
Upvotes: 0
Views: 1142
Reputation: 663
Edited:
Include the package in your build path. If you want to import a specific class just say:
packgeImportedFrom.className;
Upvotes: 1
Reputation: 751
In the project that you are importing into, make sure to set the Java Build Path to include the project that you are importing from.
Also, you can import all of the classes in a package if you do something like
import com.company.example.*
Upvotes: 1