0

我试图在 J2ME 中做一个简单的 hello world 程序,我在 ubuntu 12.04 上使用 Netbeans 7.2.1。包你好世界;

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

/**
 * @author mashombo
*/

public class Midlet extends MIDlet {

private TextBox tb;
private Display display = null;

public void helloworld(){
tb = new TextBox("Hello world Midlets"," -samboga", 100, 0);
}
public void startApp() {
    if(display == null){
    display = Display.getDisplay(this);
    display.setCurrent(tb);
    }
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}


}

当我尝试运行上述代码时,模拟器没有响应我尝试按下模拟器右侧的启动按钮,没有任何反应。这是我运行时的输出

Starting emulator in execution mode
Running with storage root /home/mashombo/j2mewtk/2.5.2/appdb/DefaultGrayPhone
Running with locale: en_ZA.UTF-8
/dev/dsp: No such file or directory
Running in the identified_third_party security domain

你能帮忙看看我有什么遗漏吗?我是 Netbeans 的新手

4

1 回答 1

0

As far as I know /dev/dsp is a device to work with OSS. Try to load it with this command:

modprobe snd-pcm-oss
于 2012-11-03T22:49:10.303 回答