Re: ProcessBuilder.start() without waiting?
Steve Sobol wrote:
On 2008-08-14, Andrea Francia <andrea.francia@gmx.REMOVE_FROM_HERE_ohohohioquesto?datogliereohohoho_TO_HERE.it> wrote:
Steve Sobol wrote:
I'd like to execute an external program using start() but the JVM waits until
the executed program exits before continuing execution.
This is strange. Post the code so someone could review it.
String path = dt.getUpdateFile().getAbsolutePath();
System.out.println("Path: " + path + "/" +
dt.getUpdateFile().getParent());
ProcessBuilder pb = new ProcessBuilder("start",path);
pb.start();
System.exit(0); // Does not get executed until the called prog ends
From the docs;
"There is no requirement that a process represented by a Process object
execute asynchronously or concurrently with respect to the Java process
that owns the Process object."
If you have a GUI program, maybe you could just close the frame and
nobody would be the wiser. Then it will exit when the process stops.
--
Knute Johnson
email s/nospam/knute2008/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access