You can make it with sublime-build package. Here is the default for python:
{
"shell_cmd": "C:\\python33\\python.exe -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
Where I have found it is, inside
[the sublime installation dir @progfiles]\Packages\Python.sublime-package
which is actually a ZIP file.
Open it with wizip / winrar / 7zip or etc
copy the file content of "Python.sublime-build" file.
Inside the Sublime Text editor, from the menu go to
Tool > Build System > New Build System
You can do same for Java easily. If cannot, let people here know.
edit:
(I got this from here)
I guess this will work. Go to the menu of Sublime as "Tool > Build System > New Build System". A new file will open, replace the content as:
{
"cmd": ["javac", "-Dfile.encoding=UTF8", "-Xlint", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
"variants": [
{ "cmd": ["javac", "-Xlint", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
"name": "Java Lintter"
},
{
"cmd": ["java", "-Dfile.encoding=UTF8", "$file_base_name"],
"name": "Run Java"
}
]
}
You can check here and here.