在sublime text 3中搭建Java开发环境

在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}""
		}
	]
}


c++

{
	"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}""
		}
	]
}



Keep it simple!
作者:N3verL4nd
知识共享,欢迎转载。
原文地址:https://www.cnblogs.com/lgh1992314/p/6616303.html