object apache is not a member of package org

2.10K viewsApache Sparkapache spark

object apache is not a member of package org

when building jar for project application I am receiving below error for all the imports

12: object apache is not a member of package org
[error] import org.apache.spark.sql.SparkSession;

Share:
hiberstackers Changed status to publish June 10, 2021
0

This error is thrown when the libraries required for the code are not included in the project. You need to include the libraries in the build.sbt file. Create a build.sbt file in your project and add the below lines in it,

name := "Spark Project"
version := "1.0"
scalaVersion := "2.10.4"
libraryDependencies += "org.apache.spark" %% "spark-core" % "2.1.0"
libraryDependencies += "org.apache.spark" %% "spark-sql" % "2.1.0"

Share:
vito Edited answer February 24, 2021
0