How to compile all java files in all subfolders on Unix, using javac?
On Windows...
Create a batch file:
for /r %%a in (.) do (javac %%a\*.java)
...then execute it in the top-level source folder.
On Linux...
javac $(find ./rootdir/* | grep .java)
Both answers taken from this thread...
http://forums.oracle.com/forums/thread.jspa?threadID=1518437&tstart=15
But as others suggested, a build tool would probably prove helpful.