Sublime two methods for compiling and running Java in Text 3

Source: Internet
Author: User

method One:Open Sublime Text 3, click Preference, Browse Packages, double-click the user folder in the open window, create a new file Javac.sublime-build, open with Notepad, paste the following code and save close: {" CMD ": [" Javac ","-encoding "," UTF-8 ","-D ",". "," $file "]," File_regex ":" ^ (... *):( [0-9]*):? ([0-9]*) "," selector ":" Source.java "," Encoding ":" GBK ",//completion of the above command to end  //The following command needs to press CTRL+SHIFT+B to run" variants ":     [        {            "name": "Run",      & nbsp     Shell: true,            "cmd":  ["Start", "cmd", "/C", "Java ${file_base _name} &echo. & Pause "],           ///C is to close the cmd window after executing the command,           /// K does not close the cmd window after executing the command.            //echo. Equivalent to entering a carriage return            //pause command to make the cmd window Press any key before closing             "work Ing_dir ":" ${file_path} ",           " encoding ":" GBK "       }   ]} ctrl+b compile, ctrl+shift+b run.   Method Two:1. Install the JDK and configure the environment variable 2. Create a new Runjava.bat file in the bin directory of the JDK, right-click Edit, copy and paste the following code and Save: @echo OFFCD%~dp1echo compiling%~nx1......if exist%~ N1.class (del%~n1.class) javac-encoding UTF-8%~nx1if exist%~n1.class (echo------Output------java%~N1) 3. Open Sublime Tex T 3, click Preference, Browse Packages, double-click the user folder in the open window, create a new file Javac.sublime-build, open with Notepad, paste the following code and save close: {"Shell_cmd": " Runjava.bat \ "$file \" "," File_regex ":" ^ (... *):( [0-9]*):? ([0-9]*) "," selector ":" Source.java "," Encoding ":" GBK "} can be saved in sublime Text 3 by Ctrl+b compiled Java run file, the disadvantage of this method can not be entered in the console, If the program needs to enter the content, then direct error

Sublime two methods for compiling and running Java in Text 3

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: info-contact@alibabacloud.com 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.