Not sure how much you know of Java yet, so let’s cover the basics; Keep in mind that ST3 itself cannot compile Java class files, it is simply a fancy text editor. However, it can be configured to call an external build tool, much the same as how Eclipse, NetBeans or Idea do. This is handled through the built-in Build System support.
If you have a look in the Tools > Build System menu, you’ll see there’s already an option configured for Apache Ant. This quite simply calls the “ant” command tool in the root of your current project folder (root of the directory tree shown in the left). This assumes your “build.xml” is in the root and that the default target is your build command, so it’s not the most flexible option ever. Beyond this, if your projects use a different build system such as Maven or Gradle, then you’ll need a new build system target for Sublime to run the “mvn” or “gradle” commands.
Alternatively, you could install Package Control and use an extra package such as Build Ant Target for some finer control.
If you don’t manage to get this working, post a few more details here and I’m sure we should be able to create a ST3 build system file that will do what you need.
[edit] Just a quick note regarding Build Ant Target, only just discovered this now, because a couple of the Java projects I have here were created in NetBeans. So, keep in mind this ST plugin won’t automatically know about all the extra config that an IDE like NetBeans, Eclipse, Idea, etc… configures when they start up. It quite literally runs a target in the current file with anything that particular script file asks for.
You might want to check with your class instructor and see what he/she says… If the build script are going to be hand crafted anyway, then you’re styling. But if they’re going to be pre-generated, you might run into a few issues.