Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

rename package

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can we rename packages in spring using myeclipse refactoring feature...i tried using refactor feature but it shows some error msgs for renaming package ...shall we rename package in myeclipse which contain several classes...if possible how can i rename it please tell me.
 
Sheriff
Posts: 16039
266
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the error message you're getting? Sometimes Eclipse will warn you about something that could be a problem but it doesn't necessarily mean you will have problems. For example, when you rename a class, Eclipse will warn you that you could potentially break scripts that refer to that class name. Eclipse issues the warning because it's not going to modify scripts and change any references to the old class name for you. It's up to you to exercise due diligence to change scripts that refer to your old class name, if you know there are any. If not, then you just ignore the warning.

On the other hand, if the problem you're being warned about is real, then perhaps some other kind of refactoring needs to be done before you rename the package.
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:For example, when you rename a class, Eclipse will warn you that you could potentially break scripts that refer to that class name. Eclipse issues the warning because it's not going to modify scripts and change any references to the old class name for you. scripts that refer to your old class name, if you know there are any.



I am not really sure what you mean by scripts, but if you mean something on the lines of non source files, then
Package Explorer -> Select class/package -> Right click -> Refactor -> Rename -> Check the option titled 'Update fully qualified names in non-Java text files (forces preview)
This has worked successfully for me in the past for web.xml file(s)
 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic