scalac compile 产生“object apache is not a member of package org" [英] scalac compile yields "object apache is not a member of package org"
问题描述
我的代码是:
import org.apache.spark.SparkContext
它可以在交互模式下运行,但是当我使用 scalac 编译它时,我收到以下错误消息:
It can run in interactive mode, but when I use scalac to compile it, I got the following error message:
object apache 不是包 org 的成员
object apache is not a member of package org
这个好像是路径的问题,但是我不知道具体怎么配置路径.
This seems to be the problem of path, but I do not know exactly how to configure the path.
推荐答案
您需要指定编译 Scala 代码时使用的库的路径.这通常不是手动完成的,而是使用诸如 Maven 或 sbt 之类的构建工具完成的.您可以在 http://spark.apache 找到最小的 sbt 设置.org/docs/1.2.0/quick-start.html#self-contained-applications
You need to specify the path of libraries used when compiling your Scala code. This is usually not done manually, but using a build tool such as Maven or sbt. You can find a minimal sbt setup at http://spark.apache.org/docs/1.2.0/quick-start.html#self-contained-applications
这篇关于scalac compile 产生“object apache is not a member of package org"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!