Creating a build file/system
is intended for this purpose. The documentation is not very expansive, and it helps to examine existing 'sublime-build' files. There seems to be two called Ant. and JavaC.sublime-build in the Packages\Java folder.
Essentially, you create a file with extension 'sublime-build' and store it in your Packages\User folder. It is possible to store it in \Java (or anywhere within \Packages) but \User is preferred. Then a new Tools/ Build System menu option will be available for you.
But I would assume that someone, somewhere
, has already gone through this process and may advise/assist you for Java.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.