java native Process timeout

Posted by deltanovember on Stack Overflow See other posts from Stack Overflow or by deltanovember
Published on 2009-08-07T23:06:09Z Indexed on 2010/03/31 13:53 UTC
Read the original article Hit count: 353

Filed under:
|

At the moment I execute a native process using the following:

java.lang.Process process = Runtime.getRuntime().exec(command); 
int returnCode = process.waitFor();

Suppose instead of waiting for the program to return I wish to terminate if a certain amount of time has elapsed. How do I do this?

© Stack Overflow or respective owner

Related posts about java

Related posts about process