For the build tree, instead of depending on the .jar file from earlier directories, directly depend on the .java files (but not the .class files). Doing that should speed up the build significantly.
*** Bug 2742 has been marked as a duplicate of this bug. ***