对象spark不是包org的成员 [英] Object spark is not a member of package org

查看:80
本文介绍了对象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:

  1. 清洁sbt
  2. sbt gen-idea (用于重建IntelliJ项目文件)
  3. 退出并重新启动IntelliJ
  1. sbt clean
  2. sbt gen-idea (to rebuild IntelliJ project files)
  3. quit and restart IntelliJ

我希望这会有所帮助.

这篇关于对象spark不是包org的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆