144

I'm trying to do a find and replace over many files within an Eclipse project, but I can't seem to find a way to do it. Googling showed me that there are plug-ins that can accomplish this, but is there any built-in functionality in Eclipse? (It seems to be a pretty basic task; it's surprising me that I can't find a way to do it.)

froadie
  • 71,770
  • 69
  • 154
  • 228

1 Answers1

267

Search->File menu (also accessible using Ctrl+H, then navigate to File tab), enter the text to search for, hit the Replace... button which will give you another dialog where you can replace text.

phuzi
  • 8,111
  • 3
  • 24
  • 43
nos
  • 207,058
  • 53
  • 381
  • 474
  • 26
    strg/ctrl + h is the shortcut ;) – j7nn7k Oct 04 '11 at 20:51
  • 2
    Does anyone know of a way to make searching across the current project the default when opening the search dialog? I constantly find myself opening the dialog, only to have to close it again, then go right-click on the project and do search from there (then make sure "selected resource" is selected in the dialog box). – Travitron Apr 27 '12 at 11:22
  • 1
    @LihO it works fine. In File Search, enter the text in `containing text`. For `File name patterns` put "*", then hit `replace` and type in the text you want to replace with – TAAPSogeking Nov 09 '14 at 16:52
  • got a Multiple annotations found at this line: - The content of element type "property" must match "null". - Attribute "type" must be declared for element type – Siddharth Aug 05 '15 at 16:47
  • Take care when you are working with Subversion system which puts the repository in the same directory. **Do not forget to exclude** the repository from the replace process! – Peter VARGA Nov 18 '15 at 16:50