Showing posts with label Running Java program in sublime. Show all posts
Showing posts with label Running Java program in sublime. Show all posts

Saturday, September 22, 2018

Compile and Run Java Program From Sublime Text 3


Dear All,

Today, I am going to write about how you can compile and run your Java program from Sublime Text.

First, you need to set a Build System. To achieve it, follow below steps:
1) Goto Tools -> Build System  -> New Build System
2) A editor tab will open. Remove all predefined code and paste below code

{
    "shell_cmd": "javac $file_name && java $file_base_name",
    "working_dir": "${project_path:${folder}}",
    "selector": "source.java"
}

After pasting above code, save file with Java.sublime-build under sublime-text-3/Packages/User/.

Now, Goto Tools -> Build System and select Java (you will see new build after following above steps).

Now press Ctrl+B and enjoy the result. Please note that Ctrl+B is used to Build your program.

Enjoy coding with this lightweight software. Do comment if above post helps you.

Thanks.

Docker Tutorial

 I have listed all the necessary commands of Docker below. In case if any is missing or if any improvement required, please share in comment...