Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut for changing package name declaration in java

Tags:

java

eclipse

We have a simple java project in eclipse and we have migrated package name for an already existing source code. Is there a shortcut for changing package name declarations while you are inside the code editor

like image 323
Jason Avatar asked Dec 01 '10 06:12

Jason


2 Answers

Select the package name, and use Refactor -> Rename (Shift+Alt+R) to open the Rename Package dialog

like image 83
Michael Mrozek Avatar answered Sep 24 '22 16:09

Michael Mrozek


Refactoring is the best way, however be wary of changing package names if your source is under version control. I've had all sorts of conflict, update issues with changing package names because of the sequence of commits done (to SVN). It does work, just can be tricky to get everything commited correctly and the repository and working directory correctly in sync.

like image 31
drekka Avatar answered Sep 22 '22 16:09

drekka