Call runtime.exec(), but not as a child process?

B

BigCohunes

Can someone show me how I would go about having a java program launch a
different program, but not as a child process?

For example, I would like my java program to launch "calc.exe". I then
want my java program to be able to finish its processing and end. I
don't want the java program to have to wait for the calc.exe process to
be finished also.

Any idea's?

Thanks
 
K

Knute Johnson

Can someone show me how I would go about having a java program launch a
different program, but not as a child process?

For example, I would like my java program to launch "calc.exe". I then
want my java program to be able to finish its processing and end. I
don't want the java program to have to wait for the calc.exe process to
be finished also.

Any idea's?

Thanks

Then don't wait for it. It should work fine as long as there isn't any
console I/O in your execed program.
 
B

BigCohunes

Then don't wait for it. It should work fine as long as there isn't any
console I/O in your execed program.


Thanks!

My problem turned out to be that I was running it in a IDE (IntelliJ).
It seems that IntelliJ did not consider the java program was finished
until the child process was exited also.

However when I ran from command line it worked as expected.

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top