Compile and Run Java in Sublime text 3

Cyphlix · 195K views · 2016 · 2:06

Open on YouTube

Testing, debugging & developer toolsPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when someone needs to get Java building and running inside Sublime Text 3, especially on Windows where the build file is hard to find.

Recommended by 2 people across 2 different months, 2016 to 2017.

What it is

A short screencast showing how to set up a custom build system in Sublime Text 3 so Java files compile with javac and run with java in one step. The description supplies the JSON build configuration to paste into a Java build file. It is presented by the Cyphlix channel.

What people said

Recommends SKB · 2016-07 · Stack Overflow · on “SUBLIME TEXT 3 JAVA BUILD RESULT NOT WORKING”

OS-WINDOWS 1. IN command palette , TYPE AND CLICK install package 2. INSTALL package resource viewer OR pvr 3.THEN COPY THIS CODE AND PASTE IN java sublime build file {"cmd":["javac","$file_name","&&","java","$file_base_name"],"file_regex":"^(...?):([0-9]):?([0-9]*)","selector": "source.java","shell": true } [this video]

Recommends Faisal · 2016-12 · Stack Overflow · on “Where I can find Javac.sublime-build file in Sublime Text 3 ? (Windows)”

@ skuroda thank you for suggestion however I finally found out how to run Java inside Sublime and for people like me out there here is the link for the same:- [this video]

Cites sepp2k · 2017-02 · Stack Overflow · on “Haskell does not return from getLine”

After doing a quick search on how Sublime runs programs, I found a youtube video [this video] (edit: and this SO post [LINK] ) which says that Sublime's "run program" functionality can only show output and isn't capable of reading input. So it looks like you'll have to run your program from the command line or from within GHCi using :main . The latter might be the most convenient as Sublime actually supports a GHCi tab, so you can still do everything from within Sublime.