Guest User

Untitled

a guest
Jun 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. Process p = Runtime.getRuntime().exec(...);
  2. p.waitFor();
  3.  
  4. final Process process = new ProcessBuilder("blah blah").start();
  5. Runtime.getRuntime().addShutdownHook(new Thread() {
  6.  
  7. @Override
  8. public void run() {
  9. process.destroy();
  10. }
  11.  
  12. });
  13. process.waitFor();
Add Comment
Please, Sign In to add comment