title: H2 Database: Error when doing migration of H2 from version 1 to 2 using Java ProcessBuilder
body: <p>I am trying to migrate user data after executing alters to some tables in h2 from version 1 to version 2 using the Java process. When trying to ran command
  java -cp h2-1.4.192.jar org.h2.tools.RunScript -url jdbc:h2:./h2db -script migrate.sql
  through java ProcessBuilder, getting end result exit code as 1 which means failure. It is not giving me the reason for failure. While the same command is successful when I ran it through the terminal. I tried to set the JAVA_HOME in the process environment map then also got exit code 1. Sample code as below</p>
  <pre><code>try {
          ProcessBuilder pb = new ProcessBuilder(&quot;/usr/bin/java&quot;, &quot;-cp&quot;, oldJarPath, &quot;org.h2.tools.RunScript&quot;,  &quot;-url&quot; , &quot;jdbc:h2:./h2db&quot; , &quot;-script&quot; , &quot;migrate.sql&quot;);
          Process process = pb.start();
          process.waitFor(4, TimeUnit.SECONDS);
          System.out.println(&quot;live:: &quot;+process.isAlive());
          while (process.isAlive()) {
              process.waitFor(4, TimeUnit.SECONDS);
          }
          exitCode = process.exitValue();
          System.out.println(&quot;exit code:: &quot;+exitCode);
      } catch (IOException e) {
          e.printStackTrace();
      } catch (InterruptedException e) {
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      }
  </code></pre>
  <p>With Environment variables map</p>
  <pre><code>try {
          ProcessBuilder pb = new ProcessBuilder(&quot;java&quot;, &quot;-cp&quot;, oldJarPath, &quot;org.h2.tools.RunScript&quot;,  &quot;-url&quot; , &quot;jdbc:h2:./h2db&quot; , &quot;-script&quot; , &quot;migrate.sql&quot;);
          Map&lt;String, String&gt; env = pb.environment();
          env.put(&quot;JAVA_HOME&quot;, &quot;/Library/Java/JavaVirtualMachines/jdk1.8.0_311.jdk/Contents/Home/&quot;);
          Process process = pb.start();
          process.waitFor(4, TimeUnit.SECONDS);
          System.out.println(&quot;live:: &quot;+process.isAlive());
          while (process.isAlive()) {
              process.waitFor(4, TimeUnit.SECONDS);
          }
          exitCode = process.exitValue();
          System.out.println(&quot;exit code:: &quot;+exitCode);
      } catch (IOException e) {
          e.printStackTrace();
      } catch (InterruptedException e) {
          e.printStackTrace();
      } catch (Exception e) {
          e.printStackTrace();
      }
  </code></pre>