当前位置: 代码迷 >> J2ME >> Exception in thread "main" java.lang.UnsatisfiedLinkError: com.
  详细解决方案

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.

热度:10855   发布时间:2013-02-25 21:38:25.0
新手提问

这是例子代码
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;

public class first extends MIDlet{
private Display display;

public first(){
display=Display.getDisplay(this);
}


protected void destroyApp(boolean arg0) {
// TODO Auto-generated method stub

}
protected void pauseApp() {
// TODO Auto-generated method stub
System.out.println("pauseApp is called.");
}
protected void startApp() {
// TODO Auto-generated method stub

System.out.println("startApp is called.");
Form f = new Form("HelloTest");



display.setCurrent(f);

}

}
为什么有时运行成功,不时不成功,
不成功时控制台输出以下信息,
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.midp.main.Configuration.getProperty0(Ljava/lang/String;)Ljava/lang/String;
at com.sun.midp.main.Configuration.getProperty0(Native Method)
at com.sun.midp.main.Configuration.getProperty(Configuration.java:32)
at com.sun.midp.lcdui.Resource.<clinit>(Resource.java:30)
at com.sun.midp.main.Main.initSystemLabels(Main.java:686)
at com.sun.midp.main.Main.main(Main.java:103)


------解决方案--------------------------------------------------------
你要展开项目,然后右击first类,运行方式,Emulated J2ME Midlet
  相关解决方案