If I were you, I'd check out ANT. IMO, you'll get a lot more mileage out of configuring your project to use it than you will getting it to work in your text editor. Especially if you're working on this code with anyone using a different editor.
Also, you can hook ANT into sublime pretty easily with your own extension.
I have mine set to run the command "ant", "clean", "compile"], where clean and compile are targets I've set up in my ANT build script.