Just want to note that - although not a complete solution - tools such as ProGuard actively remove unused classes. It might be something people didn't realise existed or was possible, so thought I'd just chime in.
Quote from ProGuard's FAQ: R.E. "What is Shrinking?"
Java source code (.java files) is typically compiled to bytecode (.class files). Bytecode is more compact than Java source code, but it may still contain a lot of unused code, especially if it includes program libraries. Shrinking programs such as ProGuard can analyze bytecode and remove unused classes, fields, and methods. The program remains functionally equivalent, including the information given in exception stack traces.
And I'll just throw this in here for whomever may be interested.