// Obtain a process executor
ProcessExecutor executor =
ProcessExecutorFactory.getDefault();
// Launch the process
Future
ProcessInputOutput.DEFAULT, null, "/bin/ls -ali");
// If you want to kill the process write:
process.cancel( true );
// To get the exit status of the process use:
System.out.println( process.get() );
Источник - здесь.
No comments:
Post a Comment