Java – intellij idea with scala error on : import org.apache.spark.{SparkContext, SparkConf}

apache-sparkintellij-ideajavasbtscala

I am using intelli j idea (like eclipse)with scala integration , i create a scala sbt project , i use spark 1.4.0 and scala 2.11.6 , I am getting error on :
import org.apache.spark.{SparkContext, SparkConf}

the file buid.sbt contains this code :

name := "simple"

version := "1.0"

scalaVersion := "2.11.6"

libraryDependencies += "org.apache.spark" % "spark-core_2.10" % "1.4.0"

when i use maven to build java application i have not problem just the problem is when i try to build scala application with sbt using intellij idea

Best Answer

Your scala version and spark scala version are wrong. Change your spark dependency:

libraryDependencies += "org.apache.spark" %% "spark-core" % "1.4.0"