Moving packages eclipse

If you have com.company.foo and com.company.bar, and want to move foo into bar, then just rename com.company.foo to com.company.bar.foo.

If you package happens to have subpackages, tick Rename subpackages to move the subpackages as well.


Use the package explorer view and rename the package. It asks for renaming updating references, renaming sub packages, update textual references in comments and and also non-Java text files. Click on the preview and then ok.


I have found the solution, when you rename a package to the desired destination, check on the box "rename subpackages" and there you go! :) – user1525788 Jul 10 at 9:14