Categories
Class 10 Class 11 Class 12 Class 8 Class 9

Execute Java from Sublime Text Editor

  1. Open Sublime Text Editor.
  2. Go to Tools > Build System > New Build System.
  3. Type the following code:
    {
    "cmd": ["javac", "$file_name","&&","start","cmd","/k","java", "$file_base_name"],
    "path":"C:\\Program Files (x86)\\Java\\jdk1.8.0_171\\bin",
    "shell": true
    }

    Make sure that you replace the path of the bin folder according to your Java installation.
    Also, add extra backslashes wherever necessary.
  4. Save it as Java.sublime-build under Sublime Text 3 > Packages > User folder.
  5. Go to Tools > Build System. Select Java from the menu.
  6. Now type a new Java program and execute it by pressing Ctrl + B.

2 replies on “Execute Java from Sublime Text Editor”

Leave a Reply