作者cates (呵,爱..)
看板java
标题[J2ME] eclipseME可以顺利跑程式但在WTK却不能跑??
时间Wed Nov 26 16:57:49 2008
大家好,我是第一次写J2ME的程式
我是用eclipseMe写的一支简单的程式
程式码如下
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.*;
public class ZeroMain extends MIDlet {
Display dis;
Form form;
public ZeroMain() {
dis=Display.getDisplay(this);
form=new Form("test");
form.append("this is test");
// TODO Auto-generated constructor stub
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
dis.setCurrent(form);
}
}
在eclipseMe模拟器有出现"this is test"
但是我想用WTK包成jar档(我是用WTK2.5.2)编译虽然成功
但是跑模拟器却出现以下的讯息
专案 "demo" 已载入
专案设置已保存
正在生成 "demo"
生成完成
使用储存体根 C:\Documents and Settings\USER\j2mewtk\2.5.2\appdb\DefaultColorPhone 来执行
Running with locale: Chinese_Taiwan.950
Running in the identified_third_party security domain
Unable to create MIDlet demo
java.lang.ClassNotFoundException: demo
at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
at com.sun.midp.midlet.Selector.run(+22)
结果没有跑出"this is test" 而出现异常 java.lang.ClassNotFoundException
的讯息,请问这是什麽问题吗??
感谢指教
P.S 我跑WTK内的其他内建app都成功
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.118.122.160
1F:推 supertitler:wtk build 时会将主程式名称预设成专案名称,设定一下 11/26 17:29
2F:→ supertitler:或者是修改一下主程式名称,看看是不是这个问题-_- 11/26 17:31
3F:→ cates:以解决!!感谢supertitler 11/27 12:33