How to use spark in the editor IDEA and scala?

i use the IDEA and scala to develop spark, but i don’t know configuration environment about the spark in the IDEA editor, Can you help me about that?

When i new a project with scala in the IDEA and MAVEN, to run the code, raise the errors,


the code followed:
class test00 {
def Print(s:String): Unit ={
println(s)
}
}
object testPrint{
def main(args: Array[String]): Unit = {
val tp = new test00()
tp.Print(“hello world”)
}
}