To exclude directory or file pattern when using find on command line one can use
! -name "pattern_to_exclude"
Example
To exclude a directory using its name
$ find . -name "*.java" ! -name "dir_to_exclude"
To exclude directory or file pattern when using find on command line one can use
! -name "pattern_to_exclude"
To exclude a directory using its name
$ find . -name "*.java" ! -name "dir_to_exclude"