DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Help with simple Java IO program running under cygwin (http://www.daniweb.com/forums/thread3473.html)

Scotty72 Mar 2nd, 2004 4:40 pm
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 <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

BountyX Mar 27th, 2004 10:02 pm
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.


All times are GMT -4. The time now is 4:57 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC