线程“main”中的异常java.lang.SecurityException:Manifest主要属性的签名文件d igest无效

时间:2022-10-11 23:05:00

I have an application that when run in the IDE (Netbeans 8) works fine. The program makes use of 4 external .jar libraries. It also has a virtual machine argument pointing to a DLL. When I try to execute the .jar from the command line I get an error. This leads me to believe that there is a classpath issue.

我有一个应用程序,在IDE(Netbeans 8)中运行时工作正常。该程序使用4个外部.jar库。它还有一个指向DLL的虚拟机参数。当我尝试从命令行执行.jar时,我收到一个错误。这让我相信存在类路径问题。

This is the error itself:

这是错误本身:

C:\Users\piuser\Documents\NetBeansProjects\GameTrakaDesktopClient\dist>java -jar
GameTrakaDesktopClient.jar
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for    
Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
        at sun.security.util.SignatureFileVerifier.process(Unknown Source)
        at java.util.jar.JarVerifier.processEntry(Unknown Source)
        at java.util.jar.JarVerifier.update(Unknown Source)
        at java.util.jar.JarFile.initializeVerifier(Unknown Source)
        at java.util.jar.JarFile.getInputStream(Unknown Source)
        at sun.misc.URLClassPath$JarLoader$2.getInputStream(Unknown Source)
        at sun.misc.Resource.cachedInputStream(Unknown Source)
        at sun.misc.Resource.getByteBuffer(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at gametrakadesktopclient.MainMenuUI.main(MainMenuUI.java:242)

C:\Users\piuser\Documents\NetBeansProjects\GameTrakaDesktopClient\dist>

1 个解决方案

#1


0  

I have used a workaround to get around this problem because I couldn't figure out a solution. I opened all of the JAR files that my application depends on and removed the META-INF/.DSA and META-INF/.SF files

我使用了一种解决方法来解决这个问题,因为我无法找到解决方案。我打开了我的应用程序所依赖的所有JAR文件,并删除了META-INF / .DSA和META-INF / .SF文件

#1


0  

I have used a workaround to get around this problem because I couldn't figure out a solution. I opened all of the JAR files that my application depends on and removed the META-INF/.DSA and META-INF/.SF files

我使用了一种解决方法来解决这个问题,因为我无法找到解决方案。我打开了我的应用程序所依赖的所有JAR文件,并删除了META-INF / .DSA和META-INF / .SF文件