Topic: 求助Jdk编译无错误运行有错误 |
Print this page |
1.求助Jdk编译无错误运行有错误 | Copy to clipboard |
Posted by: lzf200218 Posted on: 2005-08-19 14:37 import java.awt.*; import java.lang.*; public class FrameApp { public static void main(String args[]){ Frame frmHello = new Frame("HelloWorldApp"); Label lblHello = new Label("Hello World"); frmHello.add(lblHello); frmHello.setSize(500, 500); frmHello.show(); } } 这段程序使用编译无错误 运行有错误 Exception in thread "main" java.lang.NoClassDefFoundError:FrameApp 下面是运行的错误不知道为什么? |
2.Re:求助Jdk编译无错误运行有错误 [Re: lzf200218] | Copy to clipboard |
Posted by: why Posted on: 2005-08-19 19:14 Please run the following commands and copy-n-paste the contents in the Command Prompt window into your post: > echo %JAVA_HOME% > echo %PATH% > echo %CLASSPATH% > dir > java FrameApp |
3.Re:求助Jdk编译无错误运行有错误 [Re: lzf200218] | Copy to clipboard |
Posted by: yoreland Posted on: 2005-08-21 09:35 it is strange! when i compile this code, compiler put out this message: 注意: F:\myjava\FrameApp.java 使用或覆盖了已过时的 API。 注意: 要了解详细信息,请使用 -Xlint:deprecation 重新编译。 |
4.Re:求助Jdk编译无错误运行有错误 [Re: yoreland] | Copy to clipboard |
Posted by: why Posted on: 2005-08-21 20:09 yoreland wrote: Not strange at all. frmHello.show(); // show() is deprecated, use setVisible(true) instead |
5.Re:求助Jdk编译无错误运行有错误 [Re: lzf200218] | Copy to clipboard |
Posted by: brianlove Posted on: 2005-08-21 23:59 你的类是否还要继承Frame类????? |
6.Re:求助Jdk编译无错误运行有错误 [Re: lzf200218] | Copy to clipboard |
Posted by: JavaandC Posted on: 2005-08-25 13:09 没错呀;你照下面的代码在写一边,这个代码是编译运行通过的,文件名一定要合 class名字一样。 import java.awt.*; import java.lang.*; public class a { public static void main(String args[]){ Frame frmHello = new Frame("HelloWorldApp"); Label lblHello = new Label("Hello World"); frmHello.add(lblHello); frmHello.setSize(500, 500); frmHello.show(); } } |
7.Re:求助Jdk编译无错误运行有错误 [Re: JavaandC] | Copy to clipboard |
Posted by: why Posted on: 2005-08-25 18:11 JavaandC wrote: // Bad practice to use such a class name |
8.Re:求助Jdk编译无错误运行有错误 [Re: lzf200218] | Copy to clipboard |
Posted by: 傲心者 Posted on: 2005-08-28 21:02 是不是配置环境变量时候没有加.;c:\jdk\............................................. 如果是linux 偶就不知道咯! |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |