Help with simple Java IO program running under cygwin

Reply

Join Date: Mar 2004
Posts: 1
Reputation: Scotty72 is an unknown quantity at this point 
Solved Threads: 0
Scotty72 Scotty72 is offline Offline
Newbie Poster

Help with simple Java IO program running under cygwin

 
0
  #1
Mar 2nd, 2004
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 219
Reputation: BountyX is an unknown quantity at this point 
Solved Threads: 8
BountyX's Avatar
BountyX BountyX is offline Offline
Code Guru

Re: Help with simple Java IO program running under cygwin

 
0
  #2
Mar 27th, 2004
compile in windows, save the class file in linux, have the linux Java JVM run the file.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC