Forest Wood Blog Website: http://blog.csdn.net/wolinxuebin
1. Implement sublime Text 3 to Java compilation execution
Reference URL: http://tieba.baidu.com/p/2609515186
< Span style= "FONT-SIZE:14PX; line-height:26px ">1.1 found directly under the installation path *\packages\ Java.sublime-package file, open with the decompression software, find the Javac.sublime-build file, change the Javac in Shell_cmd to Javarun, save the original compressed file after the replacement, if you sublime Text 3 is already open and will be error-closed after overwriting again. The code is as follows:
{
"shell_cmd": "javaRun \"$file\"",
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
"encoding":"cp936"
}
1.2 Then create a new Javarun.bat batch file in the Bin directory under the JDK installation path, with the following content:
@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
)
You can use it after 1.3. ctrl+b
2, if the display compilation display [Decode error-output not Utf-8]
Sublimetext3\packages\java.sublime-package\javac.sublime-build\
3, compile display: encoding GBK characters
Used: http://jingyan.baidu.com/article/ca2d939dc76c89eb6c31ce96.html
Open with Notepad and save as ansi code, but still feel uncomfortable, so there are the following methods:
<pre name="code" class="plain">
Change the above, javaRun.bat to:
@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
)
Some summary of Java programming using sublime Text 3