title: How to use TwitterUtils in Spark shell?
body: <p>I'm trying to use the twitterUtils in the Spark Shell (where they are not available by default).</p>
  
  <p>I've added the following to <code>spark-env.sh</code>:</p>
  
  <pre><code>SPARK_CLASSPATH="/disk.b/spark-master-2014-07-28/external/twitter/target/spark-streaming-twitter_2.10-1.1.0-SNAPSHOT.jar"
  </code></pre>
  
  <p>I can now execute</p>
  
  <pre><code>import org.apache.spark.streaming.twitter._
  import org.apache.spark.streaming.StreamingContext._
  </code></pre>
  
  <p>without an error in the shell, which would not be possible without added the jar to the classpath ("error: object twitter is not a member of package org.apache.spark.streaming").
  However, I will get an error when executing this in the Spark shell:</p>
  
  <pre><code>scala&gt; val ssc = new StreamingContext(sc, Seconds(1))
  ssc: org.apache.spark.streaming.StreamingContext =
  org.apache.spark.streaming.StreamingContext@6e78177b
  
  scala&gt; val tweets = TwitterUtils.createStream(ssc, "twitter.txt")
  error: bad symbolic reference. A signature in TwitterUtils.class refers to
  term twitter4j in package &lt;root&gt; which is not available.
  It may be completely missing from the current classpath, or the version on the classpath might be incompatible with the version used when compiling
  TwitterUtils.class.
  </code></pre>
  
  <p>What am I missing? Do I have to import another jar?</p>