我试图将本机库包含到jar文件中。虽然我知道该怎么做,但还是少了点什么。这是清单文件。
Manifest-Version: 1.0
Class-Path: .
Main-Class: ListMediaDevices
Name: library
URL: http://jspeex.sourceforge.net/
Library-Version: 0.9.7
Library-Name: JSpeex
Name: build
Build-Date: 10/05/2010 18:59
Built-With: Linux 2.6.32-21-generic amd64
Built-By: damencho
Bundle-NativeCode:
lib/jnawtrenderer.dll;
lib/jndirectshow.dll;
lib/jnffmpeg.dll;
lib/jng722.dll;
lib/jnopus.dll;
lib/jnportaudio.dll;
lib/jnscreencapture.dll;
lib/jnspeex.dll;
lib/jnwincoreaudio.dll;
osname=Win32;processor=x86
根据规范,我确实使用UTF8编码并以新行结束文件。如何加载jar文件
java -jar pr.jar give "Error: An unexpected error occurred while trying to open file"
为了复制这个问题,我删除了整个包头以及lib参数,并添加了一个任意头"xyz:",它似乎给出了同样的错误,所以我得出结论,有些地方我的实现无法识别"bundle - native - code:"头。
其他信息
java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)
使用的库是libjitsi.jar
我认为您应该使用单个空格而不是制表符或Bundle-NativeCode
标头中的多个空格作为JAR文件规范,名称-值对和部分指定:
header: name : value
name: alphanum *headerchar
value: SPACE *otherchar newline *continuation
continuation: SPACE *otherchar newline
这是一个清单示例。为我工作的Mf片段:
Created-By: Apache Maven Bundle Plugin
Bundle-NativeCode: aaaaaaaaaaa.dll, bbbbbbbbbbb.dll, cccccccccc.dll, d
ddddddddddddddd.dll, eeeeeeeeee.dll, ffffffff.dll, ggggggggggggggg.dl
l, hhhhhhhhhhhhhhhhhh.dll, iiiiii.dll