I had this same problem. Renfei Wang's solution worked for me (I don't have enough points yet to comment directly on his response).
In Sublime, navigate to Preferences: Browse Packages>JavaC.sublime_build
.
Here's what mine looks like:
{"cmd": ["javac", "-cp", "/Users/jason/Documents/lib/*:./","$file"],"file_regex": "^(...*?):([0-9]*):?([0-9]*)","selector": "source.java"}
/Users/jason/Documents/lib/*:/
lets Sublime know the location of the directory that holds my packages, so that now when I build, it loads those packages first.