title: Runtime.exec() fails with space in directory (Java)
body: <p>I am trying to execute a process in the same directory as my Jar file by getting the location of the file with</p>
  
  <pre><code>private static File jarLocation = new File(Main.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();
  </code></pre>
  
  <p>then calling</p>
  
  <pre><code>Runtime.getRuntime().exec("command", null, jarLocation);
  </code></pre>
  
  <p>This usually works just fine but when the path has a space in it I get "The directory name is invalid". I have attempted to add some debug code which prints the path of the directory which has replaced spaces with "%20" (I assume because the ASCII hex of space is 20). is there a way to be able to use a directory with spaces in its path?</p>