Spark : Exception in thread “main” java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

后端 未结 2 463
眼角桃花
眼角桃花 2021-01-27 07:47

I wrote simple program in spark to write a dataframe to table in mySql.

The program is as follows:

import org.apache.spark.SparkConf
import org.apache.sp         


        
2条回答
  •  暖寄归人
    2021-01-27 08:32

    Eliasah was right. M2Eclipse does create a jar file but it's not a fat/uber jar. If I explicitly install the "maven assembly" plugin on the eclipse, I am able to create a fat jar with the dependency jars included and hence the program runs.

提交回复
热议问题