There's a lot of really bad examples floating around out there to do this in search results.

This shell function recursively searches starting at the current directory using the regular expression specified as the only argument for search criteria.

It does restrict the search to only those files with names ending with .class (to prevent listing directories that may make up a class's package name). If you need to locate .properties files or something else, make sure to modify accordingly.

function find-java-class() {  
  find . -name '*.jar' -type f -exec sh -c "jar -tf {} | grep -H --label {} \"$1\.class$\"" \; 
}

Place in your ~/.bashrc or other suitable shell alias file.

Verify it works:

$ cd ~/.m2
$ find-java-class ".*Factory"

Note that the argument is a regular expression so you will need to use the appropriate wildcard characters unless you are going for an exact match.