151

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.)

2 Answers 2

279

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.

Sign up to request clarification or add additional context in comments.

7 Comments

strg/ctrl + h is the shortcut ;)
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).
@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
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
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!
|
2

it is a 2 step process, not 1 step as the norm.

step 1. ctrl + H

step 2. enter image description here

step 3. enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.