错误提示如下:
Exception in thread "main" java.lang.NoClassDefFoundError: SmailFileToBigFile/Texc_Mapper
at SmailFileToBigFile.TexcMR_Driver.TexcMR_DriverMain(TexcMR_Driver.java:29)
at Main.main(Main.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: java.lang.ClassNotFoundException: SmailFileToBigFile.Texc_Mapper
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 7 more
纠结了我一个晚上,一开始的时候 我以为是没有指定主类的错误,后来检查之后发现没有错误。一个晚上都在百度和谷歌。后来我在学长的机器上打包运行了一下,发现可以运行没有错误,那个时候我确定代码是没有错误的,应该是打包的地方有问题。后来我就检查打包设置有什么不一样的地方,后来我才想到是我把“Export class files with compile warnings”这个选项给去掉了,之前因为有编译警告比较烦人,所以就取掉了,才导致后来的悲剧,后来改回来之后重新打包运行,没有问题了,哎呀,总算是解决了,希望对大家有点用~~