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.

  1. Sublime Text 2 Windows 10
  2. Sublime Text 3 Windows
  3. Sublime Text Windows Download
  4. Sublime Text Editor Windows
Details
Written by Nam Ha Minh
Last Updated on 02 July 2019 Print Email
Sublime text for windows 10Sublime 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:

However, Sublime Text 3 doesn’t have build-in support for running a Java program. So to run a Java source file, we need to configure the build system a little bit.Click Tools > Build System > New Build System… And in the untitled.sublime-build

Sublime Text 2 Windows 10

editor, type the code as follows:Save this file as Sublime text windows 10 downloadRunJava.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:

Sublime Text 3 Windows

Related Java Editors / IDEs Tutorials:

Sublime Text Windows Download

Other Java Coding Tutorials:

Sublime Text Editor Windows


About the Author:

Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.