Sublime text settings compile run Java

Source: Internet
Author: User
Tags sublime text

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": "",

"Encoding": "GBK",

Finish executing the above command.

The following command needs to press CTRL+SHIFT+B to run




"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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.