spark Failed to get main class in JAR with error null . Please specify one with --class.

运行spark-submit命令示例

bin/spark-submit \ 
--class org.apache.spark.examples.SparkPi \ 
--master yarn \ 
--deploy-mode cluster \ 
./examples/jars/spark-examples_2.12-3.0.0.jar \ 
1000

出现报错:Failed to get main class in JAR with error null . Please specify one with --class.主要是时说找不到程序入口

原因:最新的spark更改了示例,现在官方文档

./bin/spark-submit --class org.apache.spark.examples.SparkPi \
    --master yarn \
    --deploy-mode cluster \
    --driver-memory 4g \
    --executor-memory 2g \
    --executor-cores 1 \
    --queue thequeue \
    examples/jars/spark-examples*.jar \
    10

你可能感兴趣的:(spark,大数据,scala)