Application descriptor does not declare any MIDlet. Direct execution is not allowed.

netbeans自动生成的J2ME的HelloMIDlet.java,在第一次运行时,会提示Application descriptor does not declare any MIDlet. Direct execution is not allowed. 的错误,在项目的属性--应用程序描述符--MIDlet中再添加一次与已有的一模一样的就好了,但在模拟器上会有两个相同的程序,这时再删除刚才添加的MIDlet,程序也是正常的。

表现为项目的dist目录下的.jat文件中没有“MIDlet-1: HelloMIDlet, , hello.HelloMIDlet“

不知道netbeans为何会出现这种问题。

原文地址:https://www.cnblogs.com/baishahe/p/1344474.html