1

I am trying to Run java class file with the new cmd window. But i want to add the pause command at finish to view the result, so i edit the file JavaC.sublime-build like this:

{
"cmd": ["javac", "${file}"],
"working_dir": "${file_path}",
"selector": "source.java",
"shell": true,
"variants":
[
    {
        "name": "Run",
        "cmd": ["start cmd /c", ""java ${file_base_name} & pause""]
    }
]
}

But it doesn't work, the "cmd": ["start cmd /c", ""java ${file_base_name} & pause""] mean i wanna process the command start cmd /c "java ${file_base_name} & pause" but sublime-text doesn't understand "".

Anyone can solve this?

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
duclvz
  • 21
  • 4

1 Answers1

0

Sublime Text configuration files are JSON format.

JSON string escape rules can be read here

Example escape:

'{"a":5,"b":"a \\"kitty\\" mighty odd"}'
Community
  • 1
  • 1
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435