title: Running command with resource as argument
body: <p><strike>I am running a jar file on a different path on the system programmatically. One of the arguments needed is the path to a file, and the file is in my jar file. How can I pass the file (script.ospt) as an argument for another java application?</p>
  
  <p>Current code:</p>
  
  <pre><code>    Process ps = null;
      try {
          ps = Runtime.getRuntime().exec(new String[]{"java","-jar",engine.getAbsolutePath(), script3.getAbsolutePath()});
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
      try {
          ps.waitFor();
      } catch (InterruptedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  </code></pre>
  
  <p></strike></p>
  
  <p>EDIT: More explanation:</p>
  
  <p>I have a command I would like to run from java, using Runtime.getRuntime().exec().
  The command I am running requires one argument: the path to a file. If the file is in the same package as my main class, how can I use the file in my program as an argument for the command?</p>