Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scalac compile yields "object apache is not a member of package org"

My code is:

import org.apache.spark.SparkContext 

It can run in interactive mode, but when I use scalac to compile it, I got the following error message:

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.

like image 599
Jiang Xiang Avatar asked Feb 02 '15 01:02

Jiang Xiang


1 Answers

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

like image 181
tgpfeiffer Avatar answered Sep 21 '22 06:09

tgpfeiffer