Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse, moving a package from a project to another

Tags:

java

eclipse

How can i move an entire package ( along with all its content ) from an existing project to another project inside the same working set? I have tried to right click on the target package, which is contained in the first project, then "move", then i have selected the "src" folder of the second project. It didn't work, it just created a new empty package inside the second project. Any ideas?

like image 912
mark Avatar asked Sep 06 '25 21:09

mark


2 Answers

change the package presentation so that you see the all packages as a list, not as a tree, down to the level you want to move, then just drag and drop

alternatively select the package to move,
right click -> refactoring -> move
select the project and the source folder in that to move to.

like image 195
Timothy Truckle Avatar answered Sep 08 '25 10:09

Timothy Truckle


Suppose you have two different projects and they both load the same libraries:

  1. In your new project, right click the folder you want your new package – make a new package.
  2. Copy the contents you want from the old project.

That is, if you don't want to use the built-in refractor as suggested.

like image 26
Roy M Avatar answered Sep 08 '25 10:09

Roy M