title: JNLP, ProcessBuilder and file hierarchy
body: <p>Here's the picture:</p>
  
  <p>I have a code split across some jars and libraries in the following hierarchy:</p>
  
  <pre><code>Main.jar
    ---lib
        |
        ------ Secondary.jar
        ------ Lib1.jar
        ------ Libx.jar
  </code></pre>
  
  <p>The main class in Main.jar calls another main class on Secondary.jar like this:</p>
  
  <pre><code>ArrayList&lt;String&gt; commands = new ArrayList&lt;String&gt;();
  commands.add("java");
  commands.add("-cp");
  commands.add("lib"+System.getProperty("file.separator")
  +Secondary.jar+System.getProperty("path.separator")+"lib");
  commands.add("&lt;Secondary Main class cannonical path&gt;");
  System.out.printl(commands.toString().replaceAll(",",""));
  ProcessBuilder pb = new ProcessBuilder(commands);
  pb.start();
  </code></pre>
  
  <p>When I run this from the IDE and/or command prompt (the command that the println output) it works fine. When ran from javawebstart that process fails because it can't find Secondary Main class in the classpath.</p>
  
  <p>I suspect it is related to how JWS handles the downloaded resources and such.</p>
  
  <p>Any idea?</p>