Support Questions
Find answers, ask questions, and share your expertise

i created the jar file using eclipse with scala plugins. I tried running it with spark-submit, and it throws the class not fount exception. what does it means?

i created the jar file using eclipse with scala plugins. I tried running it with spark-submit, and it throws the class not fount exception. what does it means?

Explorer

[hdfs@sandbox root]$ spark-submit --class SparkWordCount --master local /usr/akila/spark-application/wordcount.jar java.lang.ClassNotFoundException: SparkWordCount

6 REPLIES 6

Re: i created the jar file using eclipse with scala plugins. I tried running it with spark-submit, and it throws the class not fount exception. what does it means?

Make sure that the class in the jar is called "SparkWordCount"

Re: i created the jar file using eclipse with scala plugins. I tried running it with spark-submit, and it throws the class not fount exception. what does it means?

Explorer

wordcount.jar is jar file created by eclipse from SparkWordCount.scala.

Re: i created the jar file using eclipse with scala plugins. I tried running it with spark-submit, and it throws the class not fount exception. what does it means?

Rising Star

it means your SparkWordCount class is not found in the jar.

Re: i created the jar file using eclipse with scala plugins. I tried running it with spark-submit, and it throws the class not fount exception. what does it means?

Rising Star

verify if the class exists.

jar tvf /usr/akila/spark-application/wordcount.jar

Re: i created the jar file using eclipse with scala plugins. I tried running it with spark-submit, and it throws the class not fount exception. what does it means?

@AKILA VEL

I believe you need to specify the full class name including it's package name, you can check full class name using below command.

bash# tar xvf wordcount.jar|grep -i SparkWordCount

once you get full class name then just mention it in --class option ( like --class com.example.test.SparkWordCount)

Re: i created the jar file using eclipse with scala plugins. I tried running it with spark-submit, and it throws the class not fount exception. what does it means?

@AKILA VEL

Please let me know if this issue got resolved after executing my suggested changes or not.