How to grep a String in all the java files in subdirectories?

Viewed 25104

I want to use grep to find the lines contain String in all java files under current directory.

I tried:

grep -r "String" **/*.java

But it doesn't work:

grep : **/*.java:  no such file or directory

How to write it?


UPDATE

I'm on windows, using the grep provided by unxUtils, which doesn't support --include parameter. Is there any other way?

2 Answers
Related