title: CommandLine using ProcessBuilder in Java and pipe between programs
body: <p>I've looking to run the following Unix command from Javas' ProcessBuilder (in Windows). </p>
  
  <pre><code>$ gensky 1 21 11 | genskyvec -m 1 &gt; skyvec_1-21-11_1.skv
  </code></pre>
  
  <p>So I've written this: </p>
  
  <pre><code>String cmd = String.format("C:\\Radiance4.2\\bin\\gensky 1 21 11 | %s -m 1 &gt; %s\n", "C:\\Radiance4.2\\bin\\genskyvec", "C:\\Radiance4.2\\temp\\output_test.skv");
  </code></pre>
  
  <p>And this: </p>
  
  <pre><code>ProcessBuilder builder = new ProcessBuilder(cmd);
  builder.redirectErrorStream(true);                  
  Process process = null;
  try {
      process = builder.start();
      System.out.println("Started Processing!");
  } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  </code></pre>
  
  <p>But continue to get error - that program not found. Any ideas what I'm doing wrong?</p>