Sublime Text 3 Setup For Programming in Java
2 min readDec 2, 2020
Generally, IDEs available for Java are too powerful. And unless you’re developing Java applications you won’t be using most of the features. So for basic programming, a much better alternative would be a text editor. And a text editor I like the most is Sublime Text. It’s fast and lightweight.
So here’s a tutorial on how to setup Sublime Text 3 for Java programming.
First of all make sure you’ve Java 8 or above installed in your system. Follow the official documentation of Java for more information.
Follow the following steps:
- Download and install Sublime Text 3.
- Go to Tools>Build System>New Build System.
A new blank file will open up with the default title untitled.sublime-build. - Copy-paste the below code to that file:
- Save the file with any name in the default location. For convenience, save as JavaRun (javaRun.sublime-build).
- Restart Sublime Text.
- Got to Tools>Build System and select JavaRun as the build system.
- And it’s done!
Now let’s see how it’ll work.
- Press CTRL+N to create a new file.
- Save it as classname.java. Let’s say, “demo.java”.
- Type the below code:
- To run, simply press CTRL+B.
- If there is no compilation error, a windows command prompt will open up with the output.
- If any error is there, it will be shown in the editor’s console.
That’s it!
Happy Coding,
Toshik