Search code examples
javaeclipserad

Replacing a line in a large number of java source files


I have around 600 java classes in a project with random names (there is no pattern in their names).

I want to replace a particular line from inside these classes with another line.

For e.g. line inside these files is

System.out.println("Product is: "+myProduct);

and I want to replace that line with

System.out.println("Object is: "+myObject);

The above line is just an example showing what I want to achieve.

I am using RAD 7.5 for development.

Is there a simple way to do this in all 600 files at once?


Solution

  • Yes. By opening the Search - File... dialog box, entering what you want to search for and the file filter you want, and then clicking Replace.