Posted: Sun Aug 27, 2006 3:23 am Post subject: java.io.IOException Bad File Descriptor
Hi,
I wrote this program a while ago using jdk 1.5.06 and it worked perfectly fine when i compiled and ran it before...
Back then I was using Windows to write and compile, right now I'm experimenting with Linux (Ubuntu distro) and have configured an editor with the compiler.... my old program compiles and builds under jdk 1.5.08 but when run it runs into this error (i believe its runtime??):
java.io.IOException Bad File Descriptor
The specific line it refers to:
Error in Console.readLine
java.io.IOException: Bad file descriptor
in
code:
System.out.print("Your selection: ");
// Asks User for Menu Selection
strInput = reader.readLine();
I'm quite puzzled :S.[/code]
Sponsor Sponsor
HellblazerX
Posted: Sun Aug 27, 2006 4:45 pm Post subject: (No subject)
Well, since you're asking the user for a selection, I'm assuming your taking the input from the keyboard. Are you sure you didn't specify your BufferedReader to receive input from a file and not the keyboard, because that would explain the error.
wuZheng
Posted: Sun Aug 27, 2006 11:19 pm Post subject: (No subject)
Well thats the thing, I'm not exactly using BufferedReader, I'm using KeyboardReader from the BreezyGUI/TerminalIO package (quick Google should bring that up) and I'm sure that the reader is directed to the keyboard in the syntax and not a filestream...
wtd
Posted: Sun Aug 27, 2006 11:28 pm Post subject: (No subject)
wuZheng wrote:
Well thats the thing, I'm not exactly using BufferedReader, I'm using KeyboardReader from the BreezyGUI/TerminalIO package
There's a simple answer to that... don't.
The standard Java library makes this strightforward enough, especially as of 1.5.