954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help with simple Java IO program running under cygwin

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 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

Scotty72
Newbie Poster
1 post since Mar 2004
Reputation Points: 10
Solved Threads: 0
 

compile in windows, save the class file in linux, have the linux Java JVM run the file.

BountyX
Posting Whiz in Training
230 posts since Mar 2004
Reputation Points: 28
Solved Threads: 9
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You