Launching Java programs from Java programs

Status
You're currently viewing only Midlands's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

Midlands

Ars Praetorian
535
Subscriptor
We've had good luck with Process.getInputStream(), Process.getOutputStream(), etc.; however, as Java has no nonblocking I/O really, we spin up new threads that transcribe from buffers to these streams and vice-versa. This works reasonably well; just make sure you synchronize properly.

Having said that, it is, in general, not terribly reliable to use Java's execution methods. If you're doing something casual, it's probably fine, but beyond that I would in fact suggest writing JNI code. I wrote a remote-execution daemon once using Java, and trying to do process control from pure Java was an exercise in pointlessness.
 
Status
You're currently viewing only Midlands's posts. Click here to go back to viewing the entire thread.
Not open for further replies.