10

I have multiple Java projects in Eclipse. I would like to reuse some classes in my new project from my old project. What is the best way to do that in Eclipse?

I.e. is it possible to add another "project folder" to the build-path for my new project?

Jonas
  • 121,568
  • 97
  • 310
  • 388

1 Answers1

13

Yes, in the build path dialog (Build Path > Configure Build Path...), go to the Projects tab, and add the project dependencies.

On the included project, you can use the Order and Export tab to select, which parts of your source folders and libraries to export to dependent projects.

Chris Lercher
  • 37,264
  • 20
  • 99
  • 131
  • After I added a project, I don't have any options under `Order and Export` tab, I can only select the whole project. What did you mean by `select which part of your source folders to export`? – Danijel Nov 14 '13 at 10:54
  • @Danijel: Use "New > Source Folder" first. Then you can select the individual folders to export, as described above. – Chris Lercher Nov 14 '13 at 11:25