The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Process related problem

Posted by Venkatesh on April 20, 2000 at 12:58 PM


I am having a small problem using the Process class in
java ( JDK1.1.6). I have written a small java class (say InputReader ) that reads the input from the keyboard and ends when the user enters the 'Ctrl+Z'.

I have another class that starts a Process thru
Runtime.getRuntime().exec() method and executes the above
program "java InputReader" . The problem is that once i
start the Process and waitFor the process to end using the Process.waitFor() method it never returns.

This happens even when i get the OutputStream of the
Process and write something to it and then close it.

Thanks in advance,



Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us