Error while running reduceByKey example to calculate daily revenue - scala code on intellij

Hi
I am getting below error while run or debuggng the scala code discussed in “Big Data WorkShop 9 video”
The code works fine when I run it in SBT console mode.

Connected to the target VM, address: ‘127.0.0.1:50725’, transport: ‘socket’
Disconnected from the target VM, address: ‘127.0.0.1:50725’, transport: ‘socket’
Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/spark/SparkConf
at DailyRevenue$.main(DailyRevenue.scala:12)
at DailyRevenue.main(DailyRevenue.scala)
Caused by: java.lang.ClassNotFoundException: org.apache.spark.SparkConf
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 2 more

Process finished with exit code 1

Can you please help debug and resolve this issue.

Thanks

Refer this link

Thanks Selvag

I tried to change the project structure -> module as suggested in the stackoverflow but I am still getting the same error message.

thanks

Hi

Thanks Selva for guiding me, I was able to resolve the issue now.

Steps that resolved this issue:

  1. removed provided from my build.sbt
  2. explicitly selected the JRE in class path (under edit configuration)

Thanks