Hi I have a problem to run an external process in java 8. Basically I jave to run ffplay from my java code, and seems that the .destroy() method doesn't work if the external process have child processes.
My code is: '''
ProcessBuilder builder = new ProcessBuilder();
builder.command().add("/usr/bin/fplay");
builder.command().add(".........."); // my args
builder.environment().put("LD_LIBRARY_PATH", myCustomLibraryPath);
Process process = builder.start();
// After
process.destroy();
process.destroyForcibly();
''' But even after doing the destroy() and destroyForcibly() the ffplay window remains open. I tried to use Runtime.getRuntime().exec(......) instead of ProcessBuilder and in this case seems that the destroy method closes the ffplay window. But I don't know how to set LD_LIBRARY_PATH in Runtime.
Is there anyone who can help me terminate the ffplay process with ProcessBuilder or setting LD_LIBRARY_PATH to Runtime.getRuntime().exec(......)?