Sublime Text Tutorial Windows
About the Tutorial Sublime Text editor is a sophisticated text editor which is widely used among developers. It includes wide features such as Syntax Highlight, Auto Indentation, File Type Recognition, Sidebar, Macros, Plug-in and Packages that make it easy for working with code base. These instructions follow my steps installing Sublime Text 2 and setting it up for working with LaTeX on my PC running Windows 7. See Chaning’s tutorial for Mac-specific instructions. If you are one of the many moving from Sublime Text to Atom check out our new Atom tutorial on the same topic: Creating Your First PDF with LaTeX and Atom.
- Sublime Text 2 Windows 10
- Sublime Text 3 Windows
- Sublime Text Windows Download
- Sublime Text Editor Windows
- Details
- Written by Nam Ha Minh
- Last Updated on 02 July 2019 Print Email
Sublime Text is a very popular editor for writing code. For Java, it supports compiling a Java source file with the default build named JavaC. Click Tools > Build System > JavaC to set the default build type for Java:Then you can compile the current Java source file by clicking Tools > Build or press the shortcut key Ctrl + B.NOTE: To be able to compile and run Java source files in Sublime, the Java compiler (javac) and Java launcher (java) programs must found in the PATH system variable. See: How to set environment variables for Java using command lineIf there’s a compilation error, Sublime captures and displays the Java compiler’s output right inside the editor like this:The .class file is generated in the same folder as the source file.In case the compilation is successful, Sublime simply displays the following message:Sublime Text 2 Windows 10
editor, type the code as follows:Save this file as
RunJava.sublime-build in the folder prompted by Sublime. Then you could see the new build appears in the menu like this:Now, to run the current Java source file, set the default build as RunJava and press Ctrl + B. Sublime captures and displays the program’s output right inside the editor like this:If you want to compile and run a Java program in just a single keystroke, modify the RunJava.sublime-build file as follows:Save the file. Now, press Ctrl + B and you will see the magic happens: the current Java source file is compiled and then executed (if no compilation errors).That’s how to compile and run a Java program with Sublime Text 3 in simple way. Happy coding!You can also watch this video to learn how to use Sublime Text editor to compile and run Java program: