title: AWS EMR Spark: Error: Cannot load main class from JAR
body: <p>I am trying to submit a spark job to AWS EMR cluster using AWS console. But it fails with: </p>
  
  <p><code>Cannot load main class from JAR</code>. The job runs successfully when I specify main class as <code>--class</code> in <code>Arguments</code> option in AWS EMR Console-> Add Step.</p>
  
  <p>On the local machine, the job seems to work perfectly fine when no main class is specified as below:</p>
  
  <pre><code> ./spark-submit /home/astro/spark-programs/SpotEMR/MyJob.jar
  </code></pre>
  
  <p>I have set main class to jar using run configuration. The main reason to avoid passing main class as <code>--class</code> is, I have to run this job in AWS Datapipeline using EMRAcivity. In AWS Datapipeline, currently there is no way to specify a main class to a job being submitted.</p>
  
  <p>Any help will be appreciated.</p>