1
votes

I am trying to build a twitter streaming example in spark using scala.

  • Spark Version : 2.0.2
  • Scala Verision : 2.11.8

While adding external jars for spark i have got spark streaming (spark-streaming_2.11-2.0.2.jar) from my spark installation folder but while adding twitter streaming jar from apache bahir i got latest as (spark-streaming-twitter_2.11-2.0.1.jar).

So while running am getting the below error in eclipse

missing or invalid dependency detected while loading class file 'TwitterUtils.class'. Could not access term twitter4j in package , because it (or its dependencies) are missing. Check your build definition for missing or conflicting dependencies. (Re-run with -Ylog-classpath to see the problematic classpath.) A full rebuild may help if 'TwitterUtils.class' was compiled against an incompatible version of . TwitterWordCount Unknown Scala Problem

Am i adding correct jar or need to change any code?

Below are my imports

import org.apache.spark.streaming.twitter._
import org.apache.spark.streaming.{StreamingContext,Seconds}
1

1 Answers

0
votes

Could not access term twitter4j in package , because it (or its dependencies) are missing.

You need to add the twitter4j jars to your build path as well.