Sublime text is a code editor (Sublime text 2 is a paid software, but can be tried indefinitely) and is also an advanced text editor for HTML and prose. Sublime text was developed by the programmer Jon Skinner in January 2008 and was originally designed as a vim with extensive functionality. Sublime text has a beautiful user interface and powerful features such as code thumbnails, Python plugins, code snippets, and more. You can also customize key bindings, menus, and toolbars. The main features of Sublime Text include: Spell checker, bookmarks, full Python API, Goto feature, instant item switching, multiple selection, multiple windows, and more. Sublime Text is a cross-platform editor that supports operating systems such as Windows, Linux, Mac os X. I personally like the sublime Text, especially the thumbnail of the code when his scroll bar. Today to share with you how to set the Java program to run in sublime text compilation. The first step, open your sublime Text, click Preferences, click on the inside of the browser plugin (also may be in English) the second step, in the user inside the new file, the suffix name is empty on the line, the file name is Javac.sublime-build, the content copy the following code:
{
"cmd": ["Javac", "-encoding", "UTF-8", "-D", ".", "$file"],
"File_regex": "^ (... *):( [0-9]*):? ([0-9]*) ",
"Selector": "Source.java",
"Encoding": "GBK",
Finish executing the above command.
The following command needs to press CTRL+SHIFT+B to run
"Variants":
[
{
"Name": "Run",
"Shell": true,
"cmd": ["Start", "cmd", "/C", "Java ${file_base_name} &echo". & Pause "],
/C is to close the cmd window after executing the command,
/k The cmd window is not closed after executing the command.
Echo. Equivalent to entering a carriage return
The pause command causes the cmd window to press any key before closing
"Working_dir": "${file_path}",
"Encoding": "GBK"
}
]
}
End, then you can in your sublime text to complete the compilation and operation of Java program, Ctrl+b compile, ctrl+shift+b run, enjoy it!!!
Sublime text settings compile run Java