当前位置: 代码迷 >> Java相关 >> 请大家帮助!谢谢
  详细解决方案

请大家帮助!谢谢

热度:142   发布时间:2005-10-02 22:11:00.0
请大家帮助!谢谢
   Exception in thread "main" java.lang.NoClassDefFoundError:Ellsworth 是怎么回事(Ellsworth是类名和文件名)   在运行Class时遇到了这个问题,请大家帮我解决一下,谢谢
原程序:
public class Ellsworth {
    public static void main(String[] arguments) {
       String line1 = "The advancement of the arts, from year\n";
       String line2 = "to year, taxes our credulity, and seems\n";
       String line3 = "to presage the arrival of that period\n";
       String line4 = "when human improvement must end.";
       String quote = line1 + line2 + line3 + line4;
       String speaker = "Henry Ellsworth";
       String title = "U.S. Commissioner of Patents";
       String from = "1843 Annual Report of the Patent Office";
       System.out.println('\u0022' + quote + '\u0022');
       System.out.println("\t" + speaker);
       System.out.println("\t" + title);
       System.out.println("\t" + from);
    }
}
----------------解决方案--------------------------------------------------------
你的问题需要看下面这段文字: ErrorExplanation Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldAppIf you receive this error, java cannot find your bytecode file,HelloWorldApp.class.One of the places java tries to find your bytecode file isyour current directory. So, if your bytecode file is in C:\java,you should change your current directory to that. To change your directory,type the following command at the prompt and press Enter:
cd c:\java
The prompt should change to C:\java>. If you enter dirat the prompt, you should see your .java and .class files.Now enter java HelloWorldApp again.If you still have problems, you might have to change your CLASSPATHvariable. To see if this is necessary, try "clobbering" the classpath withthe following command:
set CLASSPATH=
Now enter java HelloWorldApp again. If the program works now,you'll have to change your CLASSPATH variable. For more information, consultthe section 5. Update the PATH variable in the installation instructions.
----------------解决方案--------------------------------------------------------
我用jbuilder运行了一下你的程序,没有错误啊
----------------解决方案--------------------------------------------------------
我也运行了一下这个程序,,,的确没错阿
----------------解决方案--------------------------------------------------------
就是啊
----------------解决方案--------------------------------------------------------
  相关解决方案