title: How to submit a Scala job to Spark?
body: <p>I have a Pythons script that I was able to submit to Spark in the following way:</p>
  
  <pre><code>/opt/spark/bin/spark-submit --master yarn-client test.py
  </code></pre>
  
  <p>Now, I try to submit a Scala program in the same way:</p>
  
  <pre><code>/opt/spark/bin/spark-submit --master yarn-client test.scala
  </code></pre>
  
  <p>As a result I get the following error message:</p>
  
  <pre><code>Error: Cannot load main class from JAR file:/home/myname/spark/test.scala
  Run with --help for usage help or --verbose for debug output
  </code></pre>
  
  <p>The Scala program itself is just a Hello World program:</p>
  
  <pre><code>object HelloWorld {
      def main(args: Array[String]): Unit = {
          println("Hello, world!")
      }
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>