title: Spark Submit command is returning a missing application resource
body: <p>To start things off I created a jar file using this <a href="https://stackoverflow.com/questions/1082580/how-to-build-jars-from-intellij-properly">How to build jars from IntelliJ properly?</a>.</p>
  <p>My Jar files path is</p>
  <pre><code>out/artifacts/sparkProgram_jar/sparkProgram.jar
  </code></pre>
  <p>My spark program, in general, reads a table from MongoDB, transforms it using spark's mllib and writes it to MySQL.
  Here is my build.sbt file.</p>
  <pre><code>name := &quot;sparkProgram&quot;
  
  version := &quot;0.1&quot;
  
  scalaVersion := &quot;2.12.4&quot;
  val sparkVersion = &quot;3.0.0&quot;
  val postgresVersion = &quot;42.2.2&quot;
  
  resolvers ++= Seq(
    &quot;bintray-spark-packages&quot; at &quot;https://dl.bintray.com/spark-packages/maven&quot;,
    &quot;Typesafe Simple Repository&quot; at &quot;https://repo.typesafe.com/typesafe/simple/maven-releases&quot;,
    &quot;MavenRepository&quot; at &quot;https://mvnrepository.com&quot;
  )
  
  libraryDependencies ++= Seq(
    &quot;org.apache.spark&quot; %% &quot;spark-core&quot; % sparkVersion,
    &quot;org.apache.spark&quot; %% &quot;spark-sql&quot; % sparkVersion,
    &quot;org.apache.spark&quot; %% &quot;spark-mllib&quot; % sparkVersion,
    // logging
    &quot;org.apache.logging.log4j&quot; % &quot;log4j-api&quot; % &quot;2.4.1&quot;,
    &quot;org.apache.logging.log4j&quot; % &quot;log4j-core&quot; % &quot;2.4.1&quot;,
    &quot;org.mongodb.spark&quot; %% &quot;mongo-spark-connector&quot; % &quot;2.4.1&quot;,
  
    //&quot;mysql&quot; % &quot;mysql-connector-java&quot; % &quot;5.1.12&quot;,
    &quot;mysql&quot; % &quot;mysql-connector-java&quot; % &quot;8.0.18&quot;
  ).
  </code></pre>
  <p>My main class is in the package com.testing in a scala object named</p>
  <pre><code>mainObject
  </code></pre>
  <p>When I run the following spark-submit command</p>
  <pre><code>spark-submit --master local --class com.testing.mainObject
  --packages mysql:mysql-connector-java:8.0.18,org.mongodb.spark:mongo-spark-connector_2.12:2.4.1 out/artifacts/sparkProgram_jar/sparkProgram.jar
  </code></pre>
  <p>I receive this error</p>
  <pre><code>Error: Missing application resource.
  
  Usage: spark-submit [options] &lt;app jar | python file | R file&gt; [app arguments]
  Usage: spark-submit --kill [submission ID] --master [spark://...]
  Usage: spark-submit --status [submission ID] --master [spark://...]
  Usage: spark-submit run-example [options] example-class [example args]
  
  Options:
  
  
  ... zsh: command not found: --packages
  </code></pre>
  <p>And then when I attempt to run my spark-submit without the --packages(just to check what would happen) I receive this error.</p>
  <p>command:</p>
  <pre><code>spark-submit --master local --class com.testing.mainObject out/artifacts/sparkProgram_jar/sparkProgram.jar
  </code></pre>
  <p>error:
  Error: Failed to load class com.testing.mainObject</p>
  <p>I've used spark-submit before and it worked ( a couple months back). I'm not sure why this is still giving me an error. My MANIFEST.MF is the following</p>
  <pre><code>Manifest-Version: 1.0
  Main-Class: com.testing.mainObject
  </code></pre>