对象spark不是包org的成员 [英] Object spark is not a member of package org
本文介绍了对象spark不是包org的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Eclipse Scala-IDE中导入以下内容
When importing the following in Eclipse Scala-IDE
import org.apache.spark.SparkContext
import org.apache.spark.SparkContext._
我收到此错误:对象spark不是org软件包的成员
我安装了sbt-0.13.9.msi
I installed the sbt-0.13.9.msi
我还应该做什么?
build.sbt
build.sbt
name := "scala-spark-app"
version := "1.0"
scalaVersion := "2.10.4"
libraryDependencies += "org.apache.spark" %% "spark-core" % "1.5.2"
推荐答案
我在IntelliJ上收到了相同的编译错误(在Mac上),而 sbt compile
成功执行了.以下步骤解决了我的问题:
I was receiving the same compilation error (on my Mac) with IntelliJ whereas sbt compile
executed successfully. The following steps solved my problem:
- 清洁sbt
- sbt gen-idea (用于重建IntelliJ项目文件)
- 退出并重新启动IntelliJ
- sbt clean
- sbt gen-idea (to rebuild IntelliJ project files)
- quit and restart IntelliJ
我希望这会有所帮助.
这篇关于对象spark不是包org的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文