Object spark is not a member of package org

帅比萌擦擦* 提交于 2019-12-08 16:07:31

问题


When importing the following in Eclipse Scala-IDE

import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._

I get this error: Object spark is not a member of package org

I installed the sbt-0.13.9.msi

What else should I do?

build.sbt

name := "scala-spark-app"

version := "1.0"

scalaVersion := "2.10.4"

libraryDependencies += "org.apache.spark" %% "spark-core" % "1.5.2"

回答1:


I was receiving the same compilation error (on my Mac) with IntelliJ whereas sbt compile executed successfully. The following steps solved my problem:

  1. sbt clean
  2. sbt gen-idea (to rebuild IntelliJ project files)
  3. quit and restart IntelliJ

I hope this helps.



来源:https://stackoverflow.com/questions/33945368/object-spark-is-not-a-member-of-package-org

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!