title: How to run a proccess completely seperate in Java
body: <p>I have a Java program which starts another process with <code>ProcessBuilder</code> like the following:</p>
  
  <pre><code>String commands[] = {"ruby", "/home/scripts/script.rb"};
  ProcessBuilder builder = new ProcessBuilder(commands);
  Map&lt;String,String&gt; map = builder.environment();
  map.put("TYPE", "sometype");
  try {
      builder.start();
  } catch (IOException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>Some time after the process starts executing (a small Ruby Script which should not terminate) the Java program exits. </p>
  
  <p>The problem is, once the Java program finishes executing, all sub-processes are closed, also the Ruby Script.</p>
  
  <p>I found some similar questions but the answer was always, the Process is independent. But it is not like that in my case, the Ruby code will always stop executing if the Java program exits.</p>
  
  <p>I tried the Java code on a Debian Jessie System with Java 8u66</p>