| | |
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 |
account android applet application apps array automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card class classes client code collision columns component constructor database designadrawingapplicationusingjavajslider draw eclipse error eventlistener exception expand fractal free game givemetehcodez graphics gui guidancer homework html ide image inheritance integer integration intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jlabel jme jni jpanel jtextfield jtree julia linux loop method midlethttpconnection migrate mobile mobiledevelopmentcreatejar monitoring myaggfun netbeans newbie nullpointerexception open-source oracle plazmic print problem program property ria scanner server set sharepoint smart sms smsspam sourcelabs splash sql sqlite subclass support swing testautomation textfield threads tree trolltech unlimited utility windows





