Count Line Of Codes in a Directory and its Subdirectories

find . -name "*.java" -type f -exec wc -l {} \; | awk '{count += $1} END{print count}'

and another (more elegant and faster) solution by Kai:

find . -name "*.java" -type f -print0 | xargs -0 cat | wc -l