在jdk bin目录下新建一个bat文件:
如D:JAVAjdk1.8.0_65in unJava.bat
@ECHO OFF cd %~dp1 ECHO Compiling %~nx1....... IF EXIST %~n1.class ( DEL %~n1.class ) javac %~nx1 IF EXIST %~n1.class ( ECHO -----------OUTPUT----------- java %~n1 )
在sublime text 3中新建一个编译系统:
{ "shell_cmd": "runJava.bat "$file"", "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "selector": "source.java", "encoding": "UTF-8" }
保存为:
JavaC.sublime-build
c/c++配合Mingw的脚本设置:
c
{ "working_dir": "$file_path", "shell_cmd": "gcc -Wall -std=c99 "$file_name" -o "${file_path}/${file_base_name}"", "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "source.c", "variants": [ { "name": "Run", "shell_cmd": "gcc -Wall -std=c99 "$file" -o "${file_path}/${file_base_name}" && "${file_path}/${file_base_name}"" } ] }
{ "working_dir": "$file_path", "shell_cmd": "g++ -Wall -std=c++11 "$file_name" -o "${file_path}/${file_base_name}"", "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "source.c++", "variants": [ { "name": "Run", "shell_cmd": "g++ -Wall -std=c++11 "$file" -o "${file_path}/${file_base_name}" && "${file_path}/${file_base_name}"" } ] }