Sublime Forum

Allow user input when running programs (e.g. Java)

#1

I love Sublime Text 2 and want to use it as my main IDE, but I can’t compile and run Java code all without leaving the editor.

Actually, I can. I can compile and run Java via JavaC.sublime-build, after making a few modifications to it:

{
	"shell": "true",
	"cmd": "javac", "$file", "&", "java", "$file_base_name"],
	"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
	"selector": "source.java"
}

…But the problem is that if the program asks for user input, it will just give an error. So I have to use Java from the command line to get any program with user input to work.

Here is an example of the problem:

0 Likes

#2

This is a very nice feature. It would also allow us to run any shell/command tools frameworks such as rails, grails, roo, play, etc

0 Likes

#3

This is much-much harder to implement than plain stdout redirection, though I would love to have this out of the box as well.

For now take a look at github.com/wuub/SublimeREPL.

0 Likes