错误具体点,比如是什么class 产生NoClassDefFoundError的exception

解决方案 »

  1.   

    Exception in thread "main" java.lang.NoClassDefFoundError
      

  2.   

    public class Try
    {
    public static void main(String[] args)
    {
       System.out.println("number of object is:"+Sphere.getCount());
       Sphere ball=new Sphere(4.0,0.0,0.0,0.0);
       System.out.println("number of object is:"+ball.getCount());
       Sphere globe=new Sphere(10.0,1.0,1.0,1.0);
       System.out.println("number of object is:"+globe.getCount());;

    }public class Sphere
    {
    static int count=0;
    double radius;
    double x;
    double y;
    double z;
    public Sphere(double radius,double x,double y,double z)
    {
    this.radius=radius;
    this.x=x;
    this.y=y;
    this.z=z;
    ++count;
    }
    static int getCount()
    {
    return count;
    }
    } 谢谢了!
      

  3.   

    我用jdk1.3直接在cmd下运行没有问题,可是用jcreate运行时报上面的错误,这是为什么呢?请指教
      

  4.   

    不要用那小东西了,我刚学时也是用的jcreate,现在改用jbuilder,什么都不用设置,还捆绑了tomcat,很好用的!!!
      

  5.   

    你是什么系统?2000或XP很容易就可以搞定,在我的电脑上单击右键--属性--然后进到设置环境变量的那个选项卡,找到PATH,然后把你的路径写上去,有两个PATH哦,记得一起改!
      

  6.   

    用jcreator運行出錯,是jcreator的project里的jdk屬性沒有設置正確,你的classpath也許是對的,但是在jcreator里運行,就用的是jcreator的設置,與環境變量沒有關係的建議你仔細看一看jcreator的project設置jcreator很好用,很小巧快速,我是JB,JC都用.
      

  7.   

    set path=%path%;C:\jdk1.3.1_01\bin;%SystemRoot%\system32;%SystemRoot%;%
    set classpath=.;c:\jdk1.3.1_01\lib;D:\exec
      

  8.   

    classpath用大写行吗?
    我用2000只改了一个path就行了。