spark submit add multiple jars in classpath

Avinash Nishanth S picture Avinash Nishanth S · Mar 17, 2015 · Viewed 112.3k times · Source

I am trying to run a spark program where i have multiple jar files, if I had only one jar I am not able run. I want to add both the jar files which are in same location. I have tried the below but it shows a dependency error

spark-submit \
  --class "max" maxjar.jar Book1.csv test \
  --driver-class-path /usr/lib/spark/assembly/lib/hive-common-0.13.1-cdh​5.3.0.jar

How can i add another jar file which is in the same directory?

I want add /usr/lib/spark/assembly/lib/hive-serde.jar.

Answer

pzecevic picture pzecevic · Mar 17, 2015

Just use the --jars parameter. Spark will share those jars (comma-separated) with the executors.