Sublime Text 3 Configuring the Java Program Runtime Environment (console input available)

Source: Internet
Author: User
Tags sublime text

The situation before the blogger configuration
1.64-bit notebook 2. WIN10 System 3. The Java Environment 4 has been configured. Sublime is installed and the package control component is configured.

Specific process:

1. Sublime Text 3--->preference--->browse Packages, double-click the user folder in the open window and create a new file named "Javac.sublime-build" under the folder. Open the file with sublime, paste the following code and save

{    "cmd": ["Javac", "-encoding", "UTF-8", "-D", ".", "$file"],    "File_regex": "^ (... *):( [0-9]*):? ([0-9]*) ",    " selector ":" Source.java ",    " encoding ":" GBK ",    //execute the above command at the end    //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 the command is finished.        //echo. Equivalent to entering a carriage return        //pause command to make the cmd window Press any key before closing        "Working_dir": "${file_path}",        "encoding": "GBK"    }]}

2. Create a new test file and save it as Hello.java

ImportJava.util.Scanner; Public classHello { Public Static voidMain (String args[]) {Scanner s=NewScanner (system.in); System.out.println ("Input string, exit terminates ====>");  while(S.hasnextline ()) {String line=S.nextline (); if(Line.equals ("Exit"))                 Break; System.out.println ("Out==>" +Line ); }    }}

3. Press Ctrl+shift+b will pop up an option, for example, select "JavaC" to compile;

Press Ctrl+shift+b to select "JavaC Run".

Operating effect:

Transfer from https://my.oschina.net/xldc/blog/468862

Sublime Text 3 Configuring the Java Program Runtime Environment (console input available) (RPM)

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: 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.