Setting Up Sublime Text 3 for Competitive coding in Java

Akanksha
2 min readJan 7, 2022

Set up sublime text 3 for competitive coding in 5 easy steps

Photo by Headway on Unsplash

Step 1. Install JDK and Sublime Text 3

Install a suitable version of JDK and Sublime text 3 on your local machine.

Step 2. Set up environment variables

  1. Right click the computer icon on your Desktop and select Properties
  2. Chose environment variables under Advanced system settings
  3. Edit the path variable so that it also contains the path to the Java executable, it generally looks like, “C:\Program Files\Java\jdk\bin”
  4. Save your changes and try running “where java” command to confirm that the variable is set.

Step 3. Set Up files

Create a new folder and add 3 files to it- “input.TXT”, “output.TXT” and, “Main.java”

Step 4. Set Up Sublime Text

  1. Go to File>Open Folder and open the folder you have created in step 3
  2. Go to View>Layout, and Select, “Columns: 3”
  3. Go to View>Groups, and Select, “ Max Columns: 2”
  4. Select the first column and open Main.java in it. Similarly, open input.TXT and output.TXT in adjoining Columns
it should look something like this
  1. Go to Tools>Build System and Select, “New Build System”
  2. Paste the following code in the .sublime-build file that opens up and save it

7. Change the “path” attribute to the path variable of jdk executable in your system

Step 5. Now Check This Out

Write your java program in Main.java, (be careful to name your class as Main), go to tools and change the build system to the build system you have saved in step 4.

Build your project from Tools> Build (or just press keys ctrl+B) and it should take input from and yield output to your input-output files

--

--