title: Java Process watcher
body: <p>Is it possible in java to wait to see if a process is killed and if it is to immediately restart it?</p>
  
  <p>A bit more in depth of what I am trying to do:</p>
  
  <p>App1(main)
  Starts separate process app2 / thread that watches app1(main)
  if app 2 is killed it restarts it
  (Does other code)</p>
  
  <p>App2
  Watches main process/app1 and if it is killed it restarts it</p>
  
  <p>I would appreciate any help you could provide. I looked through the java docs of the process and processbuider classes and didn't notice anything that might help me out.</p>