Skip to content

Instantly share code, notes, and snippets.

@bramus
Created September 23, 2014 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bramus/c1a396ab6a96f7426a8f to your computer and use it in GitHub Desktop.
Save bramus/c1a396ab6a96f7426a8f to your computer and use it in GitHub Desktop.
Sublime Text Build System to compile and successively run a java source file.
// Installation: In Sublime select "Tools" > "Build System" > "New" and paste the contents of this gist in a file named `JavaCompileAndRun.sublime-build`
// Usage: In Sublime text select "Tools" > "Build System" > "JavaCompileAndRun". Hit CMD + B to execute it.
// @note: untested on Windows (but should work)
{
"windows": {
"shell": true,
"cmd": [
"javac", "$file", "&;",
"java", "$file_base_name"
]
},
"osx": {
"shell": false,
"cmd": [
"sh", "-c", "javac $file && java $file_base_name"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment