-1

I have a Gradle project that contains packages that I'd like to rename from "com.bar.pkg1" to "com.foo.pkg1". I would use Refactor -> Rename except the listing in Package Explorer looks like:

myproject
  com
    bar
      pkg1

so I can't select the entire "com.bar.pkg1" path to rename. I tried to ask Package Explorer to change from hierarchical to flat view, but that had no effect.

Mark Lavin
  • 1,002
  • 1
  • 15
  • 30
  • Possible duplicate of [Renaming packages in Eclipse](http://stackoverflow.com/questions/1355818/renaming-packages-in-eclipse) – u32i64 Mar 26 '17 at 16:11

1 Answers1

-1

You need to change the package presentation style to flat first:

enter image description here

Timothy Truckle
  • 15,071
  • 2
  • 27
  • 51
  • 1
    TImothy, thanks for your answer, but (as I said in my question) I tried flattening the Package Presentation in Package Explorer but that had no effect. I think that somehow I need to convince Eclipse that this is a Java project, as well as a Gradle project. – Mark Lavin Mar 26 '17 at 16:24
  • Did you open the *Java* perspective and the *package explorer* within it? What is your eclipse version? Did you import the Project as *existing Gradle Project*? – Timothy Truckle Mar 26 '17 at 16:25
  • Yes, I opened the Java perspective and Package Explorer within it. Yes, I imported the project as an _existing gradle project_ (because I could not figure how to import it as a Java project, since the import-> only lists Java EE.) I'm using Eclipse Juno. – Mark Lavin Mar 26 '17 at 16:53
  • Before digging deeper: can you switch to a more recent eclipse version? – Timothy Truckle Mar 26 '17 at 16:59
  • Oops, sorry, I'm using Eclipse Luna; recent enought? – Mark Lavin Mar 26 '17 at 17:07
  • *" I'm using Eclipse Luna; recent enought?"* not really, *Neon* is currently on R3... – Timothy Truckle Mar 26 '17 at 17:10