string-replaceって何ぞ。

M-x find-grep

find . -type f -name "*.java" -exec grep -nH -e '検索文字列' {} +

でひっかけてwgrepで置換すれば。