Re: Exec



Francois Lionet wrote:
Hi all,

First of all, I must thank you : I have asked 5 questions in this forum, and each time I had a good answer that really helped me. So thank you!

My new question :
I want to launch an external program from my application (currently under Windows, but I want it to work as well on a Mac and Linux). I have the pathname to the application (as a File object). But I can't find the method to actually launch the application. I have searched in the system object, and the file object. No success.
Can anyone tell me how to do this?

Thanks in advance.

Francois



Hi Francois,

have a look at the various exec() methods in java.lang.Runtime, this is perhaps what you are looking for.

But beware that their use is somewhat tricky, as you have to consume the process' output, else it may block when some internal buffer is full.

I can send you some helper class for Runtime.exec(), just send me a short email to /d/5/0/3/@/d/i/r/e/c/t/b/o/x/./c/o/m , without the slashes, of course :-)

Cheers
Andreas
.