title: java.io.IOException: Cannot run program java.exe (in directory "src") - error from Executable Jar
body: <p>My code is working fine in Eclipse but when I am exporting from eclipse in executable jar format or by using maven, I am getting the below error:</p>
  
  <p>Full error : </p>
  
  <pre><code>java.io.IOException: Cannot run program "C:\myPrograms\jdk1.7.0_79\bin\java.exe" (in directory "src"): CreateProcess error=267, The directory name is invalid
      at java.lang.ProcessBuilder.start(Unknown Source)
      at TestAuomation.Jobs.execJob(Jobs.java:154)
      at TestAuomation.Jobs$Build_JobParams.runJob(Jobs.java:67)
      at TestAuomation.intelliPerf$BackgroundTask.doInBackground(intelliPerf.java:849)
      at TestAuomation.intelliPerf$BackgroundTask.doInBackground(intelliPerf.java:845)
      at javax.swing.SwingWorker$1.call(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at javax.swing.SwingWorker.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.io.IOException: CreateProcess error=267, The directory name is invalid
      at java.lang.ProcessImpl.create(Native Method)
      at java.lang.ProcessImpl.&lt;init&gt;(Unknown Source)
      at java.lang.ProcessImpl.start(Unknown Source)
      ... 11 more
  </code></pre>
  
  <p>I am able to launch the program from jar but getting this error when trying do to some operation which invokes java -jar  .... I am running this inside my program using process builder</p>
  
  <p>Please suggest what I am doing wrong</p>