Using Wildcards in rm -r?

I’m on OS X and I’m at a loss. I’m trying to remove all .class files in a directory tree. On linux I’d just do

rm -r *.class

But OS X tells me

rm: *.class: No such file or directory