开发者

problem with importing a package in eclipse

开发者 https://www.devze.com 2023-03-13 04:26 出处:网络
I am trying to import a package from one project in eclipse to another. Both projects are found in the same eclipse workarea.

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 t开发者_JAVA技巧hey could be imported?

Thank you. Avi

Update: Adding the project to the java build path did the trick.

Thanks again. Avi


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.*


Edited:

Include the package in your build path. If you want to import a specific class just say:

packgeImportedFrom.className;

0

精彩评论

暂无评论...
验证码 换一张
取 消