我的程序在 IDE 上编译后运行良好,但是当我尝试运行创建的 .jar 时,出现以下错误:
java -jar /Users/bigbitecode/Documents/workspace/sys\ client_b/sys-client/out/artifacts/sys_client_jar/sys-client.jar
Exception in thread "main" java.lang.SecurityException: no manifiest section for signature file entry com/sun/java/help/impl/TagProperties.class
at sun.security.util.SignatureFileVerifier.verifySection(SignatureFileVerifier.java:399)
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:250)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:193)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:305)
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.JarIndex.getJarIndex(JarIndex.java:137)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:668)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:660)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:659)
at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:632)
at sun.misc.URLClassPath$3.run(URLClassPath.java:362)
at sun.misc.URLClassPath$3.run(URLClassPath.java:352)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:351)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:328)
at sun.misc.URLClassPath.getResource(URLClassPath.java:194)
at java.net.URLClassLoader$1.run(URLClassLoader.java:358)
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:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
我已经阅读了几个类似的问题,这似乎是由于我作为依赖项使用的一个有问题的 jar 引起的,但我不知道是哪一个或如何找到它。但是,一旦我这样做了,我如何将它从 jar 中排除?
这会是intelliJ的原因吗?是否可以通过终端构建 jar?
编辑: - 我做了一个 jar -tf sys-client.jar 它显示了所有文件,包括清单。
- 目前我的清单有以下内容:
Manifest-Version: 1.0
Main-Class: SysClient.data.gui.SysClient