| | |
Help with simple Java IO program running under cygwin
![]() |
•
•
Join Date: Mar 2004
Posts: 1
Reputation:
Solved Threads: 0
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
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
- exe java program by html link? (Java)
- Run Unix Find command using java Program (Java)
- simple coin program (Java)
- Running Java Program outside an IDE (Java)
- java program to calculate simple interest (Java)
- Error message when running simple Java pgm (Java)
Other Threads in the Java Forum
- Previous Thread: I/O Filestreams in Java
- Next Thread: Java Game Applet Too Small
| Thread Tools | Search this Thread |
-xlint actionlistener android api applet application array arrays automation bi binary blackberry block bluetooth character class client code compile compiler component consumer database desktop developmenthelp eclipse error fractal freeze ftp functiontesting game gameprogramming givemetehcodez graphics gui health html ide image integer j2me j2seprojects java javac javaee javaprojects jetbrains jni jpanel jtable julia learningresources lego linked linux list mac main map method methods mobile myregfun netbeans notdisplaying number online printf problem program project qt recursion researchinmotion rotatetext rsa scanner screen server set singleton sms sort spamblocker sql string swing system textfields threads time title tree tutorial-sample update variablebinding windows working xor





