title: Submitting Python file and Java jars to Spark- Error: No main class set in JAR; please specify one with --class
body: <p>I have to execute a python file with user defined Java functions using py4j.
  I am using a spark-submit command to send the pyfiles and jars to the executors. The code I've written for Py4j will handle the rest.</p>
  
  <p>However I received an error </p>
  
  <blockquote>
    <p>Error: No main class set in JAR; please specify one with --class</p>
  </blockquote>
  
  <p>The command is as follows:</p>
  
  <pre><code> spark-submit  --files /home/USER/PATH/SOMEFILE.txt --conf spark.executor.extraClassPath= /home/USER/DEFINED_FUNCTIONS/IN JAVA/XYZ/XYZ.jar  --executor-memory 512m  --driver-class-path /home/USER/DEFINED_FUNCTIONS/IN JAVA/XYZ/XYZ.jar  --master local[*]  --jars /home/USER/DEFINED_FUNCTIONS/IN JAVA/XYZ/XYZ.jar  --driver-memory 512m  --py-files /home/USER/PATH/eggs/kafka.egg,/home/USER/PATH/eggs/redis.egg,/home/USER/PATH/helloworld.egg,/home/USER/PATH/helloworld.py
  </code></pre>
  
  <p>My problem is that I don't have a Java class to specify. I have python files, so what am I supposed to exactly specify?</p>
  
  <p>Also I have used the --jars, --conf spark.executor.extraClassPath, --driver-class-path options to send the jar to the executors as it contains the user defined functions. </p>
  
  <p>Simply mentioning --jars or --driver-class-path wasn't doing the job so tried the third parameter, which raised the error.</p>
  
  <p>Thanks in advance.</p>