Check module example's dependency (right click examples and click Open Modules Settings), by default scala-library is provided, you need to change it to compile to run SparkPi in Intellij. As I remember, you also need to change guava and jetty related library to compile too.
On Mon, Aug 17, 2015 at 2:14 AM, xiaohe lan <zombiexco...@gmail.com> wrote: > Hi, > > I am trying to run SparkPi in Intellij and getting NoClassDefFoundError. > Anyone else saw this issue before ? > > Exception in thread "main" java.lang.NoClassDefFoundError: > scala/collection/Seq > at org.apache.spark.examples.SparkPi.main(SparkPi.scala) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) > Caused by: java.lang.ClassNotFoundException: scala.collection.Seq > 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) > ... 6 more > > Process finished with exit code 1 > > Thanks, > Xiaohe > -- Best Regards Jeff Zhang