Home Download Buy Blog Forum Support

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

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

Postby cookiesui on Tue Sep 04, 2012 11:46 pm

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:
Code: Select all
{
   "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:
Image
cookiesui
 
Posts: 2
Joined: Tue Mar 13, 2012 11:40 pm

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

Postby mario.melo on Wed Sep 12, 2012 6:47 pm

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
mario.melo
 
Posts: 1
Joined: Wed Sep 12, 2012 6:45 pm

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

Postby xeno.by on Wed Sep 12, 2012 7:22 pm

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 https://github.com/wuub/SublimeREPL.
xeno.by
 
Posts: 106
Joined: Mon Jan 30, 2012 10:03 am
Location: Lausanne, Switzerland


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 11 guests