Does Eclipse have a way to search a whole project for some text like Xcode's "find in project" feature?
-
5And for multi-line regex-based search, see http://stackoverflow.com/questions/3164453/how-to-search-and-replace-2-lines-via-eclipse/3164884#3164884 – VonC Jul 04 '10 at 15:00
-
214Basic feature of an IDE made so difficult in eclipse that I needed to google. Wow. – NightFury Mar 26 '14 at 00:02
-
14Though, to be fair, it's under the `Search` menu. ;^) – ruffin Nov 20 '14 at 16:13
-
11@ruffin while find/replace is under "Edit" – serine May 18 '16 at 11:08
-
@opticyclic Or NetBeans. That also has a search feature that is much easier to use than Eclipse's. – cst1992 Oct 19 '16 at 09:03
-
@NightFury Use Visual Studio Code instead, Luke! – hellboy Nov 09 '18 at 09:02
-
Exit vim is much more easy that finding in Eclipse – hellboy Nov 09 '18 at 09:03
-
@hellboy That was 4 years old ago. I am a fan of IntelliJ IDEs. They are love :) – NightFury Nov 09 '18 at 12:34
-
With Eclipse 4.13 2019-09, check out the new Quick Search: see [my answer below](https://stackoverflow.com/a/58042367/6309) – VonC Sep 21 '19 at 17:01
14 Answers
1. Ctrl + H
2. Choose File Search for plain text search in workspace/selected projects
For specific expression searches, choose the relevant tab (such as Java Search which allows you to search for specific identifiers)
For whole project search:
3. Scope (in the form section) > Enclosing project (Radio button selection).

- 28,994
- 18
- 176
- 206

- 161,610
- 92
- 305
- 395
-
22"CTRL-H -> File Search (TAB) -> Scope (FORM SECTION) -> Enclosing projects (RADIO BUTTON OPTION)" will work for only the current project where you are coding. – JStrahl Sep 06 '13 at 07:17
-
2@Strahlee that is actually what brought me to this question. ctrl+H is well documented over the internet, but it does a global search on ALL projects in the package explorer, which is very very annoying. By using the Enclosing Projects option, it appears to limit the search per project. The answer here should be updated to reflect this. – JohnMerlino Jun 16 '14 at 05:33
-
5With Eclipse Kepler, you need to fill the `File name patterns` too, e.g with `*`. Until this information is given, the `Search` button is grayed. Didn't know a search function could be so cryptic before meeting with Eclipse. – mins Sep 15 '14 at 21:16
-
1I have multiple projects, but only want to search one. How do I do that? – Mawg says reinstate Monica May 23 '17 at 10:00
Ctrl + Alt + G can be used to find selected text across a workspace in eclipse.
OSX: ⌥ Option + ⌘ Command + G

- 6,880
- 16
- 81
- 127

- 24,713
- 30
- 122
- 169
Press Ctrl + H to bring up the search that includes options to search via project, directory, etc.

- 71,546
- 23
- 135
- 174
Ctrl+H.
Also,
Open any file quickly without browsing for it in the Package Explorer: Ctrl + Shift + R.
Open a type (e.g.: a class, an interface) without clicking through interminable list of packages: Ctrl + Shift + T.
Go directly to a member (method, variable) of a huge class file, especially when a lot of methods are named similarly: Ctrl + O
Go to line number N in the source file: Ctrl + L, enter line number.

- 44,500
- 61
- 101
- 156

- 345
- 3
- 3
Ctrl + H is the best way! Remember to copy the string before you start searching!

- 15,962
- 9
- 47
- 85

- 435
- 4
- 10
-
For me, if I have the string selected, it shows up in the search box after I press `Ctrl+H` – Jake Toronto May 02 '14 at 16:46
-
1- copy & paste the same thing two others already answered / - get 11 likes / - welcome to stackoverflow – phil294 Aug 13 '15 at 17:00
You should check out the new Eclipse 2019-09 4.13 Quick Search feature
The new Quick Search dialog provides a convenient, simple and fast way to run a textual search across your workspace and jump to matches in your code.
The dialog provides a quick overview showing matching lines of text at a glance.
It updates as quickly as you can type and allows for quick navigation using only the keyboard.
A typical workflow starts by pressing the keyboard shortcut Ctrl+Alt+Shift+L
(or Cmd+Alt+Shift+L on Mac).
Typing a few letters updates the search result as you type.
Use Up-Down arrow keys to select a match, then hit Enter to open it in an editor.
-
1Yes, this is what I`ve been looking for, although, 4 key combination is little too much to remember. Is there any other way to trigger this very window? Thank you in advance. – rchrd Jul 28 '20 at 13:06
-
1@rchrd Not that I know of. I use three keys to remember the 4 keys combinations: https://stackoverflow.com/a/4105518/6309, https://stackoverflow.com/a/1986236/6309 – VonC Jul 28 '20 at 15:24
CTRL + H is actually the right answer, but the scope in which it was pressed is actually pretty important.
When you have last clicked on file you're working on, you'll get a different search window - Java Search:
Whereas when you select directory on Package Explorer and then press Ctrl + H (or choose Search -> File..
from main menu), you get the desired window - File Search:
yes, but you need to open the global search panel. to do so, press the binoculars icon on the top right corner of the IDE.
you can even filter searches by function identifiers, method scopes an etc...
- Choose File Search for plain text search in workspace/selected projects
- For specific expression searches, choose the relevant tab (such as Java Search which allows to search for specific identifiers)
-
3My version of Eclipse doesn't have binoculars in the upper right (or anywhere that I can find). – Brian Knoblauch Jun 17 '11 at 15:09
First customize your search dialog. Ctrl+H. Click on the Customize button and select inly File Search while deselecting all the others. Close the dialog.
Now you can search by selecting the word and hitting the Ctrl+H and then Enter.

- 7,603
- 6
- 44
- 104

- 1,804
- 1
- 15
- 24
yes, but you need to open the global search panel. to do so, press the binoculars icon on the top right corner of the IDE.
you can even filter searches by function identifiers, method scopes an etc...

- 785
- 5
- 22
There is no way to do pure text search in whole work workspace/project via a shortcut that I know of (and it is a PITA), but this will find references in the workspace:
- Put your cursor on what you want to lookup
- Press Ctrl + Shift + g

- 16,299
- 4
- 85
- 85
-
-
1Did you mean https://marketplace.eclipse.org/content/quick-search-eclipse ? – Christophe Roussy Jun 12 '17 at 13:36
-
There is very nice tool "Eclipse Quicksearch" available. Checkout SpringSource Update Site for Eclipse i.e: http://dist.springsource.com/release/TOOLS/update/e4.6/ (you can try other versions replacing last part of URL with i.e. e4.4 or e4.5)
It works well with Neon Release (4.6.0). It gives you nice incremental text search with source file preview. I had no issues with it so far.
Usage: Alt + s "Quick Search Command" opens "Quick Text Search" dialog. You can select whether search should be case sensitive or not. Really good tool.

- 913
- 10
- 12
-
1yes, that tool is really helpful, I would recommend it to everyone using Eclipse – Erdinc Ay Jun 12 '17 at 12:52
Ctrl+H is very handy here. I mostly search in the current project, not the whole workspace. To find all occurences in the whole project of a string that is in your current buffer, just select the string press Ctrl+H and hit enter. Easy as that!
Use Resource Filters! Eclipse will restrict the search result using the Resource Filters defined for your project (eg. right click on you project name and select Properties -> Resource -> Resource Filters). So if you keep getting search hits from parts of your project that your not interested in you could make Eclipse skip those by adding a Resource Filter for them. This is especially useful if you have build files or logs or other temporary files that are part of your projects directory structure, but you only want to search amongst the source code. You should also be aware of that files/directories matched for exclusion in the Resource Filters will not show up in the Package Explorer either, so you might not always want this.

- 7,603
- 6
- 44
- 104

- 11
- 3
What others have forgotten is Ctrl+Shift+L for easy text search. It searches everywhere and it is fast and efficient. This might be a Sprint tool suit which is an extension of eclipse (and it might be available in newer versions)

- 7,603
- 6
- 44
- 104

- 29
- 3
-
1The default binding for this combination is "Show Key Assist" now. Don't know what you were referring to. – Noumenon Aug 18 '15 at 14:00