37

Possible Duplicate:
Eclipse Replace text in all Classes?

I want to replace all instances of Foo.bar() with Foo across all files in my workspace in eclipse. Is there a way of doing this?

Community
  • 1
  • 1
Viral Shah
  • 2,888
  • 2
  • 22
  • 25
  • 1
    Why has this been marked as a duplicate of a question that was asked over half a year later? If anything, [Eclipse replace text in all classes](http://stackoverflow.com/q/3376440/983430) should be a duplicate of this, shouldn't it? Another duplicate: [Is there a way to find/replace across an entire project in Eclipse?](http://stackoverflow.com/q/3426049/983430) – Amos M. Carpenter Dec 29 '16 at 02:23

1 Answers1

57

When you do a text-based search in eclipse (using the flashlight button at the top of the screen and selecting the right tab) there's a "Replace..." button at the bottom of the dialog. Press that, instead of search, and you can do a global find and replace.

Alternatively, you can use the refactoring feature to change it to something else.

Malaxeur
  • 5,973
  • 1
  • 36
  • 34
  • Window - show view - search.. then ctrl+h, here we can replace all the text occurrences in workspace in a single click. – DevGo Mar 30 '17 at 10:37