If I change something in the hierarchy, the everything lower changes.
Yes, like I said, you don't need to recompile everything. Only the stuff higher in the dependency hierarchy needs to be recompiled. You don't have to compile the stuff deeper in the dependency hierarchy.
Also I tried running javac in `` quotes, but it never returns anything.
That captures what javac prints to STDOUT. I suggested you check its exit code. See the return value of system.