Compiling and Running Java Code in Sublime Text 2

前端 未结 19 2845
执念已碎
执念已碎 2020-11-28 01:20

I am trying to compile and run Java code in Sublime Text 2. Don\'t just tell me to do it manually in the Command Prompt. Can anyone tell me how?

Btw, I am on Windows

19条回答
  •  天命终不由人
    2020-11-28 02:05

    compile and running as per documentation of sublime text 2 nd 3

    step- 1: set environment variables for java as u know already or refer somewhere

    strp-2: open new document and copy paste code below

    {
    "cmd": ["javac", "$file_name", "&&", "java", "$file_base_name"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.java",
    "shell":true }
    

    step-3: save the document as userjavaC.sublime-build in directory C:\Users\myLapi\AppData\Roaming\Sublime Text 3\Packages\User

    step-4:

    after done select as tools->build systems->userjavaC

    to both compile and run press ctrl+b

提交回复
热议问题