mark
mark

Reputation: 959

Eclipse, moving a package from a project to another

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?

Upvotes: 4

Views: 6087

Answers (2)

Roy M
Roy M

Reputation: 21

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.

Upvotes: 2

Timothy Truckle
Timothy Truckle

Reputation: 15622

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.

Upvotes: 9

Related Questions