分享

java.lang.ClassNotFoundException

harryxujiao 发表于 2013-10-16 13:40:01 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 1 5663
The problem is :java.lang.ClassNotFoundException: Test_2
the jar file is compiled on shell,but if I export the jar from Eclipse,there is no any problem.
and the job can run normally.
What's the matter???
Shell record:
[hadoop@Client ~]$ hadoop jar test2.jar Test_2 Rtest2 22o hadoop
Exception in thread "main" java.lang.ClassNotFoundException: Test_2
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
              
               
                    Hadoop
                    JAR
                    Eclipse
               

已有(1)人评论

跳转到指定楼层
tntzbzc 发表于 2013-10-16 13:40:36

            test2.jar没有找到Test_2这个CLASS
先确认你的代码有没有package
如果你的代码没有package
检查你的代码Test_2这个CLASS文件是否编译进去了
还有,你的Test_2是否有Main函数
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条