Search code examples
intellij-idea

How to change all the package easily?


I copy util package from other project to my project.

But all the java files' package is still the previous package path, so it is wrong.

enter image description here

See the upper snapshot, all the file under the util folder I copied from other project is still the com.jackov.common.util, how can I easily change the package to correct package instead of modify one by one.


Solution

  • Copy them to the original package they were in the old project (create it in the new project), then use Refactor | Move to move them to another package (or Rename the package). IDE will update all the imports automatically.