3

我已经检查了有这个问题的其他线程,但他们的情况和解决方案不适用于我的情况。

该程序应该在蓝牙设备和计算机之间建立连接,并且应该从所述设备接收数据。因此,我正在使用蓝牙连接所需的库,这些库本身包含清单文件。我猜这就是问题发生的地方。

我已经尝试过使用不同的 JDK,但没有成功。

这是整个错误消息:

Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:240)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:193)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:262)
at java.util.jar.JarVerifier.update(JarVerifier.java:216)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:345)
at java.util.jar.JarFile.getInputStream(JarFile.java:412)
at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:775)
at sun.misc.Resource.cachedInputStream(Resource.java:77)
at sun.misc.Resource.getByteBuffer(Resource.java:160)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:436)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.intel.bluetooth.BlueCoveImpl.loadStackClass(BlueCoveImpl.java:358)
at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:454)
at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:70)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1085)
at java.security.AccessController.doPrivileged(Native Method)
at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1083)
at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1076)
at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
at de.offis.medical.sensor.discovery.linux.bluetooth.DiscoveryBT.<init>(DiscoveryBT.java:50)
at Helper.getDiscoveries(Helper.java:27)
at Main.startSensorDemo(Main.java:31)
at Main.main(Main.java:46)
4

1 回答 1

4

尝试从 jar 中删除 META-INF 文件夹,添加清单并再次签署 JAR,它帮助了我:http: //jehy.ru/articles/2013/12/13/invalid-signature-file-digest-for-manifest-main-属性/

于 2013-12-13T07:05:42.473 回答