Created
September 23, 2014 18:15
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// 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