The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001



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.


Question regarding the caveat...

Posted by Hiran on November 21, 2001 at 4:02 AM

Is it possible to determine the status of a process once it's been executed using Runtime.exec()? Ex. if I start playing a sound file (sound.wav) using "start c:\sound.wav" as the command that is passed to Runtime.exec(), is there any way to check if the sound file is done playing, to be able to play another sound file? Checking to see if the process has finished doesn't work (I've tried it), cause once Runtime.exec() is called and the command is executed, the process finishes (from the JVM's point of view).

> Well, there is one caveat: if you are starting a process with Runtime.exec(), it is really outside the JVM and can continue after the JVM's demise.

> - mfg

> > Hiran,

> > every single activity in your application only exists when the jvm is running. once the jvm stops, everything is terminated. :p equivalent to when the world ends.. except if u store things in database, when u restart the jvm, the world comes into life again and everything is reloaded from the database :p

> > man, i'm talking crap (i'm serious about the "everything exists only when the jvm is running, once the jvm is gone, your thread is gone")


Sponsored Links

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