C:\WTK22\apps\cmdProject\classes> c:/wtk22/bin/emulator-Xdescriptor HelloWorld.jad后出现如下提示:
com.sun.kvem.midletsuite.InvalidJadException: Reason = 13
文件 Manifest 缺少必需的属性: MIDlet-Name
我的Mainfest.mf文件是这样的:
MIDlet-1: HelloWorld,,HelloWorld
MIDlet-Jar-URL:HelloWorld.jar
MIDlet-Name:HelloWorld
MIDlet-Vendor:J2MEdev,RT Inc.
MIDlet-Version: 1.0
MicroEdition-Configuration:CLDC-1.0
MicroEdition-Profile:MIDP-2.0
我的jad文件是:
MIDlet-Jar-Size:1418
MIDlet-1: HelloWorld,,HelloWorld
MIDlet-Jar-URL:HelloWorld.jar
MIDlet-Name:HelloWorld
MIDlet-Vendor:J2MEdev,RT Inc.
MIDlet-Version: 1.0
MicroEdition-Configuration:CLDC-1.0
MicroEdition-Profile:MIDP-2.0
期待解决中,谢谢了
------解决方案--------------------------------------------------------
属性的冒号后面必须有一个英文的空格,提示的错误MIDlet-Name应该修改为
MIDlet-Name: HelloWorld
~这里有个空格
ps:最好用wtk来生成manifest和jad
另外其它的属性很多也都存在这个问题
MIDlet-Jar-Size: 1418
MIDlet-1: HelloWorld,,HelloWorld
MIDlet-Jar-URL: HelloWorld.jar
MIDlet-Name: HelloWorld
MIDlet-Vendor: J2MEdev,RT Inc.
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-2.0
------解决方案--------------------------------------------------------
而且你的运行方式也不对,应该这样
C:\WTK22\bin\emulator.exe -classpath "path " -Xdevice:DefaultColorPhone -Xdescriptor: "*.jad "
path处给出你编译好的CLASS文件路径,*.jad为要运行JAD的路径