Sublime Text 添加java环境
jre/bin/ 目录下添加 runJava.bat
@ECHO OFF
cd %~dp1
ECHO Compiling %~nx1.......
IF EXIST %~n1.class (
DEL %~n1.class
)
javac -encoding UTF-8 %~nx1
IF EXIST %~n1.class (
ECHO -----------OUTPUT-----------
java %~n1
)
如图找到java.sublime-packege
接下来用压缩软件提取出 该java包里的JavaC.sublime-build
文件修改内容入下
{
"shell_cmd": "runJava.bat \"$file\"",
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
"encoding": "cp936"
}
测试
public class Test{
public static void main(String[] args){
System.out.println("sublime can run Java!");
}
}
专注于JavaWeb