本地测试spark项目的时候报错
Exception in thread “main” java.lang.NoClassDefFoundError: scala/Function1
at com.whzy.B102.WordCount.main(WordCount.scala)
Caused by: java.lang.ClassNotFoundException: scala.Function1
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 1 more
检查下 pom.xml文件种有不有
<scope>provided</scope>
有的话删掉就行了