Hi Raymond,

I see that you can make a small correction in your spark-submit command. Your 
spark-submit command should say:


spark-submit --master local --class <full package name>.<className> < Jar 
Location and JarName> <application arguments>


Example:


spark-submit --master local \

--class retail_db.GetRevenuePerOrder 
C:\RXIE\Learning\Scala\spark2practice\target\scala-2.11\spark2practice_2.11-0.1.jar
 \

C:\RXIE\Learning\Data\data-master\retail_db\order_items \
C:\RXIE\Learning\Data\data-master\retail_db\order_items\revenue_per_order



Also, I believe you can "\" to split the commands in the multiple lines even on 
windows


Best Regards,
Vamshi T

________________________________
From: Raymond Xie <xie3208...@gmail.com>
Sent: Sunday, June 17, 2018 5:07 AM
To: user; Hui Xie
Subject: spark-submit Error: Cannot load main class from JAR file

Hello, I am doing the practice in windows now.
I have the jar file generated under:
C:\RXIE\Learning\Scala\spark2practice\target\scala-2.11\spark2practice_2.11-0.1.jar

The package name is Retail_db and the object is GetRevenuePerOrder.

The spark-submit command is:

spark-submit retail_db.GetRevenuePerOrder --class 
"C:\RXIE\Learning\Scala\spark2practice\target\scala-2.11\spark2practice_2.11-0.1.jar"
 local   C:\RXIE\Learning\Data\data-master\retail_db\order_items 
C:\C:\RXIE\Learning\Data\data-master\retail_db\order_items\revenue_per_order

When executing this command, it throws out the error:
Error: Cannot load main class from JAR file

What is the right submit command should I write here?


Thank you very much.

By the way, the command is really too long, how can I split it into multiple 
lines like '\' in Linux?




------------------------------------------------
Sincerely yours,


Raymond

Reply via email to