KafkaUtils class not found in Spark streaming

后端 未结 9 1543
囚心锁ツ
囚心锁ツ 2021-01-11 20:14

I have just began with Spark Streaming and I am trying to build a sample application that counts words from a Kafka stream. Although it compiles with sbt package

相关标签:
9条回答
  • 2021-01-11 20:37

    You could also download the jar file and put it in the Spark lib folder, because it is not installed with Spark, instead of beating your head trying to bet SBT build.sbt to work.

    http://central.maven.org/maven2/org/apache/spark/spark-streaming-kafka-0-10_2.10/2.1.1/spark-streaming-kafka-0-10_2.10-2.1.1.jar

    copy it to:

    /usr/local/spark/spark-2.1.0-bin-hadoop2.6/jars/

    0 讨论(0)
  • 2021-01-11 20:38

    Using Spark 1.6 do the job for me without the hassle of handling so many external jars... Can get quite complicate to manage...

    0 讨论(0)
  • 2021-01-11 20:41

    Added the Dependency externally, project-->properties--> java Build Path-->Libraries--> add External jars and add the required jar.

    this solved my issue.

    0 讨论(0)
提交回复
热议问题