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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.