943,724 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 8373
  • Java RSS
Mar 2nd, 2004
0

Help with simple Java IO program running under cygwin

Expand Post »
Hi all,

I have copied the following Java IO example from a manual:

public class Act2_15
{
public static void main (String args[]) throws java.io.IOException
{
int v = System.in.read();
System.out.println("Value read was " + v);
}
}

but find that, when I compile and run it under bash, the program does not wait for an input and instead passes straight through, giving a value of 13 or <CR> as I understand.

When I compile and run the same code under Dos, I have no problems and the code runs as I would expect it.

This behaviour would seem to be true of all the Java IO examples I try to run under cygwin.

Any ideas ?

Cheers in advance,

Scotty
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Scotty72 is offline Offline
1 posts
since Mar 2004
Mar 27th, 2004
0

Re: Help with simple Java IO program running under cygwin

compile in windows, save the class file in linux, have the linux Java JVM run the file.
Reputation Points: 28
Solved Threads: 9
Posting Whiz in Training
BountyX is offline Offline
222 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: I/O Filestreams in Java
Next Thread in Java Forum Timeline: Java Game Applet Too Small





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC