Yes you can. But this is actually what spark-submit does for you. Actually spark-submit do more than that. You can refer here https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
What's your purpose for using "java -cp", for local development, IDE should be sufficient. On Tue, Mar 29, 2016 at 12:26 PM, Fei Hu <hufe...@gmail.com> wrote: > Hi, > > I am wondering how to run the spark job by java command, such as: java -cp > spark.jar mainclass. When running/debugging the spark program in IntelliJ > IDEA, it uses java command to run spark main class, so I think it should be > able to run the spark job by java command besides the spark-submit command. > > Thanks in advance, > Fei > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > > -- Best Regards Jeff Zhang