Find files by content with find and grep

$ find ./directory-parent/ -type f -name *.java -exec grep -H ScriptException {} \;