26

Is there a command to replace a string of code with another in all .java files in an Eclipse project?

In Visual Studio there is a "Replace in all files" option that I can't seem to find in Eclipse.

Ian Vink
  • 66,960
  • 104
  • 341
  • 555

5 Answers5

37

Press Ctrl+H or look in the Search menu for Search>Search or Search>File depending on version. At bottom of dialog box, click Replace... There you'll find the replace in files functionality.

Arpit Gupta
  • 91
  • 1
  • 6
walterbing1
  • 533
  • 3
  • 6
14

Press Ctrl+H or look in the Search menu for Search>Search or Search>File Search Tab. At bottom of dialog box, click Replace

enter image description here

Rajesh
  • 4,273
  • 1
  • 32
  • 33
  • There's no replace button in 22022.03 version. Why on earth did they flip Crtl-F and Ctrl-H common use?? – Evgen May 09 '23 at 21:39
3

I have tried the following option in Helios Version of Eclipse. Simply press CTRL+F you will get the "Find/Replace" Window on your screen

enter image description here

Chinmoy
  • 493
  • 1
  • 5
  • 16
0

I don't know about command but just press 'ctrl+h' the dialog that appears woulh have what you need

Gopi
  • 10,073
  • 4
  • 31
  • 45
0

Select the word and press alt+shift+r then replace the word, it should reflect in all classes.

RMPR
  • 3,368
  • 4
  • 19
  • 31