解决idea编写spark程序时,import org.apache.spark报错

问题描述

导入spark程序时,spark显示不能识别此符号
解决idea编写spark程序时,import org.apache.spark报错_第1张图片

解决:

解决idea编写spark程序时,import org.apache.spark报错_第2张图片
解决idea编写spark程序时,import org.apache.spark报错_第3张图片
去官网下载对应spark版本的压缩包,链接
解压,既有jars目录
或者pom.xml加入

  <dependency>
      <groupId>org.apache.sparkgroupId>
      <artifactId>spark-core_2.11artifactId>
      <version>2.2.0version>
    dependency>
    <dependency>
      <groupId>org.apache.sparkgroupId>
      <artifactId>spark-sql_2.11artifactId>
      <version>2.2.0version>
    dependency>
    <dependency>
      <groupId>org.apache.sparkgroupId>
      <artifactId>spark-mllib_2.11artifactId>
      <version>2.2.0version>
    dependency>
    <dependency>
      <groupId>com.databricksgroupId>
      <artifactId>spark-csv_2.11artifactId>
      <version>1.4.0version>
    dependency>
    <dependency>
      <groupId>org.apache.sparkgroupId>
      <artifactId>spark-streaming-kafka_2.11artifactId>
      <version>1.6.3version>
    dependency>

你可能感兴趣的:(idea,idea,spark)