DOS下 jar 时发生错误 java.io.IOException: invalid header field

hanhsh 2004-06-23 11:29:26
getMIDletProperties.java

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class getMIDletProperties extends MIDlet
{
private Display aDisplay;
private Form aForm;
private TextField aTextField;
private String proString="";
public getMIDletProperties()
{
proString=proString+"Vendor:"+getAppProperty("MIDlet-Vendor")+"\n";
proString=proString+"Description:"+getAppProperty("MIDlet-Description")+"\n";
proString=proString+"CreateDate:"+getAppProperty("Create Date")+"\n";
proString=proString+"MIDlet-Data-Size:"+getAppProperty("MIDlet-Data-Size")+"\n";
aForm=new Form("MIDlet Properties");
aTextField=new TextField("properties:",proString,5000,TextField.ANY);
aForm.append(aTextField);
}
public void startApp() throws MIDletStateChangeException
{
aDisplay=Display.getDisplay(this);
aDisplay.setCurrent(aForm);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
}


MANIFEST.MF

MIDlet-Name:Show_Properties_MIDlet
MIDlet-Version:1.0.0
MIDlet-Vendor:AlexWen
MIDlet-1:ShowProps,/suite.png,getMIDletProperties
MicroEdition-Profile:MIDP-2.0
MIDlet-Description:List The MIDlet Properties
MIDlet-Data-Size:1500

DOS下运行
D:\java\getpros>javac -g:none -bootclasspath F:\Java\midp2.0fcs\classes getMIDletProperties.java

D:\java\getpros>preverify -classpath F:\Java\midp2.0fcs\classes getMIDletProperties

D:\java\getpros>jar -cvfm getPros.jar MANIFEST.MF getMIDletProperties.class suite.png
java.io.IOException: invalid header field
at java.util.jar.Attributes.read(Attributes.java:387)
at java.util.jar.Manifest.read(Manifest.java:167)
at java.util.jar.Manifest.<init>(Manifest.java:52)
at sun.tools.jar.Main.run(Main.java:124)
at sun.tools.jar.Main.main(Main.java:904)
...全文
254 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
sy5591 2004-07-01
  • 打赏
  • 举报
回复
用wtk打包 有没有问题哦?
k4 2004-07-01
  • 打赏
  • 举报
回复
使用Ktoolbar:把类文件放src,图片放res,jad文件放bin,manifest.mf放bin
就OK
楼主是不是在用J2ME无线通信实用案例教程上的例子嘛?
呵呵

13,100

社区成员

发帖
与我相关
我的任务
社区描述
Java J2ME
社区管理员
  • J2ME社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧