我加入了新的包和类,但是使用的时候报java.lang.NoClassDefFoundError错。
加入的方法是用winrar打开rt.jar,直接将新的.class拖入

解决方案 »

  1.   

    应该是新的.class包名问题吧
      

  2.   

    我在Eclipse项目中能看到新的rt.jar,并且测试程序也能编译通过,就是运行时报找不到类的错误
      

  3.   

    我加入了新的包org.apache.xml,里面有若干类,而不是在原来已有的包中加新类。我在试用jar命令,怀疑用winrar添加有问题
      

  4.   

    重构不行啊,有些类在src.zip里面没有源代码
      

  5.   

    刚在另外一个地方问了,说不能在rt.jar中加入新的类。。
      

  6.   

    说错了,应该是不能加入新的包
    经过测试,可以加入新的类并可用,Class.forName不抛异常
      

  7.   

    Why do you do that?
    I cannot see any good point to do that.When you see "NoClassDefFoundError", there must be something wrong with the CLASSPATH. I mean there MUST be something wrong with CLASSPATH, although you may check and declare it is correct.