title: CreateProcess error=5, Access is denied when trying SparkLauncher example in Win10
body: <p>I'm getting the following exception:</p>
  
  <pre><code>Exception in thread "main" java.io.IOException: Cannot run program "E:\Software\spark-1.6.1\bin\spark-submit.cmd": CreateProcess error=5, Access is denied
      at java.lang.ProcessBuilder.start(Unknown Source)
      at org.apache.spark.launcher.SparkLauncher.startApplication(SparkLauncher.java:418)
      at com.wwa.spark.poc.SimpleAppLauncher.main(SimpleAppLauncher.java:13)
  Caused by: java.io.IOException: CreateProcess error=5, Access is denied
      at java.lang.ProcessImpl.create(Native Method)
      at java.lang.ProcessImpl.&lt;init&gt;(Unknown Source)
      at java.lang.ProcessImpl.start(Unknown Source)
      ... 3 more
  </code></pre>
  
  <p>When I'm trying to run the SparkLauncher example from <a href="https://github.com/apache/spark/blob/master/launcher/src/main/java/org/apache/spark/launcher/package-info.java" rel="nofollow">https://github.com/apache/spark/blob/master/launcher/src/main/java/org/apache/spark/launcher/package-info.java</a></p>
  
  <p>My code is:</p>
  
  <pre><code>public static void main(String[] args) throws IOException {
      SparkAppHandle handle = new SparkLauncher().setAppResource("E:/spark-poc-0.0.1-SNAPSHOT.jar")
              .setMainClass("com.wwa.spark.poc.SimpleApp").setMaster("spark://spark1:7077").setConf(SparkLauncher.DRIVER_MEMORY, "2g")
              .startApplication();
  }
  </code></pre>
  
  <p>I've tried changing the permissions on the spark-submit.cmd file, but with no luck. Then, I tried to ensure all my spark installation had the correct permissions and granted permission to run to all logged in users, but that also resulted in the error pasted above.</p>
  
  <p>It works perfectly if I run spark-submit.cmd from the command line.</p>