title: spark-shell, dependency jars and class not found exception
body: <p>I'm trying to run my spark app on spark shell. Here is what I tried and many more variants after hours of reading on this error...but none seem to work.</p>
  
  <pre><code>spark-shell --class my_home.myhome.RecommendMatch —jars /Users/anon/Documents/Works/sparkworkspace/myhome/target/myhome-0.0.1-SNAPSHOT.jar,/Users/anon/Documents/Works/sparkworkspace/myhome/target/original-myhome-0.0.1-SNAPSHOT.jar
  </code></pre>
  
  <p>What is get instead is </p>
  
  <pre><code>java.lang.ClassNotFoundException: my_home.myhome.RecommendMatch
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:348)
  at org.apache.spark.util.Utils$.classForName(Utils.scala:229)
  at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:695)
  at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:187)
  at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:212)
  at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:126)
  at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  </code></pre>
  
  <p>Any ideas please? Thanks!</p>
  
  <p>UPDATE:
  Found that the jars must be colon(:) separated and not comma(,) separated as described in several articles/docs</p>
  
  <pre><code>spark-shell --class my_home.myhome.RecommendMatch —jars /Users/anon/Documents/Works/sparkworkspace/myhome/target/myhome-0.0.1-SNAPSHOT.jar:/Users/anon/Documents/Works/sparkworkspace/myhome/target/original-myhome-0.0.1-SNAPSHOT.jar
  </code></pre>
  
  <p>However, now the errors have changed. Note ls -la finds the paths although the following lines complain that don't exit. Bizarre..</p>
  
  <pre><code>Warning: Local jar /Users/anon/Documents/Works/sparkworkspace/myhome/target/myhome-0.0.1-SNAPSHOT.jar:/Users/anon/Documents/Works/sparkworkspace/myhome/target/original-myhome-0.0.1-SNAPSHOT.jar does not exist, skipping.
  Setting default log level to "WARN".
  To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
  java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
  at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:314)
  at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:268)
  </code></pre>
  
  <p>UPDATE 2:</p>
  
  <pre><code>spark-shell  —class my_home.myhome.RecommendMatch —-jars “/Users/anon/Documents/Works/sparkworkspace/myhome/target/myhome-0.0.1-SNAPSHOT.jar:/Users/anon/Documents/Works/sparkworkspace/myhome/target/original-myhome-0.0.1-SNAPSHOT.jar”
  </code></pre>
  
  <p>The above command yields the following on spark-shell. </p>
  
  <pre><code>Setting default log level to "WARN".
  To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use    setLogLevel(newLevel).
  17/05/16 01:19:08 WARN NativeCodeLoader: Unable to load native-hadoop   library for your platform... using builtin-java classes where applicable
  17/05/16 01:19:13 WARN ObjectStore: Failed to get database global_temp,  returning NoSuchObjectException
  Spark context Web UI available at http://192.168.0.101:4040
  Spark context available as 'sc' (master = local[*], app id = local-1494877749685).
  Spark session available as 'spark'.
  Welcome to
        ____              __
       / __/__  ___ _____/ /__
      _\ \/ _ \/ _ `/ __/  '_/
     /___/ .__/\_,_/_/ /_/\_\   version 2.1.0
        /_/
  
  Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_121)
  Type in expressions to have them evaluated.
  Type :help for more information.
  
  scala&gt; :load my_home.myhome.RecommendMatch 
  That file does not exist
  
  scala&gt; :load RecommendMatch 
  That file does not exist
  
  scala&gt; :load my_home.myhome.RecommendMatch.scala 
  That file does not exist
  
  scala&gt; :load RecommendMatch.scala
  That file does not exist
  </code></pre>
  
  <p>The jars don't seem to be loaded :( based on what I see at <a href="http://localhost:4040/environment/" rel="nofollow noreferrer">http://localhost:4040/environment/</a></p>