Community
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

java.io.IOException reading System.in

 
Post new topic   Reply to topic    Community Forum Index -> Java
View previous topic :: View next topic  
Author Message
bbadmin
Site Admin


Joined: 17 Feb 2003
Posts: 583

PostPosted: Mon Sep 15, 2003 4:50 pm    Post subject: java.io.IOException reading System.in Reply with quote

One of the configuration options for TextPad's user tools is Capture output. This is nice, because it has the effect of redirecting the tool's standard output channel to the Command Results window. However, TextPad does not pass on any keystrokes to the tool's standard input channel, so if you have some code like this:

Code:
    System.out.print("Enter your name: ");
    name = new BufferedReader(new InputStreamReader(System.in)).readLine();


readLine will fail with java.io.IOException, because it does not have ownership of the keyboard. You must run the application in a console window, if it needs any keyboard input, so do not check Capture output for the Run Java Application tool.

Keith MacDonald
Helios Software Solutions
Back to top
View user's profile Send private message Visit poster's website
klangenfarben



Joined: 10 Jan 2005
Posts: 11
Location: Brattleboro, Vermont, USA

PostPosted: Sat Feb 16, 2008 8:47 am    Post subject: Reply with quote

nice catch.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB