NetBeans headless platform application: read from stdin
"stever" <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm following this guide:
http://wiki.netbeans.org/DevFaqNonGuiPlatformApp
I would like to create a shell environment based on the NetBeans platform where the user runs my application from a command line and then interacts with it using a custom set of commands.
However, I can't read from the System.in. read calls do not block and return -1.
Here is my project.properties file where the run arguments are concerned:
Code:
run.args.extra=--nosplash --nogui
I've also added this:
Code:
-J-Djava.awt.headless=true
but it made no difference.
Here is my restored() code from my ModuleInstall implementation:
Code:
@Override
public void restored() {
System.out.println("****** started *******");
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
try {
String s = r.readLine();
System.out.println("s: " + s);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
The stdout writes work corretly.
s in this case is null and it does not block.
Any ideas?