`

jar打包时碰到的错误: java.io.IOException: invalid header field

    博客分类:
  • osgi
 
阅读更多
cmd窗口执行打包命令: jar cvfm example5.jar manifest.mf com
报错:
java.io.IOException: invalid header field
        at java.util.jar.Attributes.read(Attributes.java:393)
        at java.util.jar.Manifest.read(Manifest.java:182)
        at java.util.jar.Manifest.<init>(Manifest.java:52)
        at sun.tools.jar.Main.run(Main.java:151)
        at sun.tools.jar.Main.main(Main.java:1149)

原因: Bundle-Activator项的键和值之间少了一个空格
Bundle-Name: Service Tracker-based dictionary client
Bundle-Description: A dictionary client using the Service Tracker.
Bundle-Vendor: Apache Felix
Bundle-Version: 1.0.0
Bundle-Activator:com.wwt.example5.Activator
Import-Package: org.osgi.framework,
org.osgi.util.tracker,
com.wwt.example2.service

修改为:Bundle-Activator: com.wwt.example5.Activator即可
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics