C:\YingSoft\YingJAD>javac -g helpDecompile.javaC:\YingSoft\YingJAD>jdb helpDecompile.java
Initializing jdb ...
> stop at helpDecompile:32
Deferring breakpoint helpDecompile:32.
It will be set after the class is loaded.
> run
run helpDecompile.java
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started:
Exception occurred: java.lang.ClassNotFoundException (uncaught)"thread=main", ja
va.net.URLClassLoader$1.run(), line=198 bci=72main[1]
/********************************************************************************/
首先说明我用Javac,java编译和执行都没有问题.
为何调试的时候会出现ClassNotFoundException异常

解决方案 »

  1.   

    C:\YingSoft\YingJAD>jdb -classpath . helpDecompile
    Initializing jdb ...
    > stop at helpDecompile
    Usage: stop at <class>:<line_number> or
           stop in <class>.<method_name>[(argument_type,...)]
    > stop at helpDecompile:1
    Deferring breakpoint helpDecompile:1.
    It will be set after the class is loaded.
    > run
    run helpDecompile
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Unable to set deferred breakpoint helpDecompile:1 : No code at line
    1 in helpDecompileStopping due to deferred breakpoint errors.
    No frames on the current call stack加上-classpath参数后,上面的问题就解决了,但出现了No code at line
    1 in helpDecompile
    什么原因啊?
    /*****************************************************************************/
    原代码如下所示
    class test 
    {int a;int b;test(int aa,int bb){a = aa;b = bb;}int add(){return a+b;}}public class helpDecompile{public static void main(String args[]){int a = 2;int b = 3;int c= a+b;System.out.println(c); test kk=new test(1,2);System.out.println(kk.add());}
     
    }