简体   繁体   中英

How to import one Eclipse project as a library into another?

I would like to use one of my eclipse projects in another one. Is there a 'smooth' way to do that, without having to export one as a jar file and importing it into another? Especially since I work on both project simultaneously, I would like the latest changes from the imported project to be automatically built and imported into the other one. Is that possible?

It is possible. Right click on your project -> Build Path -> Configure Build Path. Switch to the Projects tab and add one. It will work as a library.

PS You might also want to check this: Creating a java library with Eclipse

Answer to this question explains how to import your own library in eclipse.

Quoting from the answer.

Just have "Project" reference your "Library", on windows the process is (using menu / tab names)

  1. Go to: Project -> Properties -> Java Build Path -> Projects
  2. Client Add...
  3. Select your "Library" project from the list
  4. Click Ok
  5. Click the other Ok Now your done and you can use import for classes in your "Library"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM