This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hello, I am in instructor at a community college and I have many students who can't get something to work under Windows 2000 with jdk1.3. They are trying to perform a simple System.in.read() and they get this: java.io.IOException: The handle is invalid at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileInputStream.java:183) at java.io.BufferedInputStream.fill(BufferedInputStream.java:186) at java.io.BufferedInputStream.read(BufferedInputStream.java:204) at Demo.main(Demo.java:8) Exception in thread "main" I can't reproduce this on my Linux box and the students in the class who are running Windows 98 also are not having any problems. Can anyone help? Thanks...
Can you post Demo.java? ------------------ Phil Hanna Sun Certified Programmer for the Java 2 Platform Author of : JSP: The Complete Reference Instant Java Servlets Website: http://www.philhanna.com
Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
I can't remember the fix to this one off the top of my head, but I remember reading it on Sun's Java forums awhile ago. Do a search there and you should be able to find it. Jayson Falkner V.P./CTO, Amberjack Software LLC Jayson@jspinsider.com www.jspinsider.com
Jayson Falkner<br />jayson@jspinsider.com<br />Author of <a href="http://www.jspbook.com" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>
Eric Knapp
Greenhorn
Joined: May 06, 2001
Posts: 4
posted
0
Phil Hanna asked me to post the sample app that I used for this. Here it is: public class Demo {
public static void main(String args[]) throws Exception { char userInput; int a = 2; System.out.println("Please enter a character."); userInput = (char) System.in.read(); System.in.read(); System.in.read(); System.out.println("You entered: " + userInput); } }
The class works just fine where ever I try it. I now have a Win 2000 setup and it works fine for me. Some of my students get the errors that I posted earlier on the first System.in.read(). -Eric P.S. I guess this wasn't the correct forum for this. I'm new to JavaRanch.
Eric Knapp
Greenhorn
Joined: May 06, 2001
Posts: 4
posted
0
I have searched every forum that I can find including the one at Sun and I have not been able to find the answer to this one. Any hints would be greatly appreciated! Thanks, -Eric
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: "java.io.IOException: The handle is invalid" in Win 2000