Java JAR文件未由可信签名者签名,如何解决?

摘要:现象 启动程序报错,同时在classpath下有多个bcprov-jdk开头的包 Caused by: java.util.jar.JarException: file:C:Users93986.gradlecachesmodu
现象 启动程序报错,同时在classpath下有多个bcprov-jdk开头的包 Caused by: java.util.jar.JarException: file:/C:/Users/93986/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk18on/1.78/619aafb92dc0b4c6cc4cf86c487ca48ee2d67a8e/bcprov-jdk18on-1.78.jar is not signed by a trusted signer. at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:502) ~[?:1.8.0_71] at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322) ~[?:1.8.0_71] at javax.crypto.JarVerifier.verify(JarVerifier.java:250) ~[?:1.8.0_71] at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:160) ~[?:1.8.0_71] at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:186) ~[?:1.8.0_71] at javax.crypto.Cipher.getInstance(Cipher.java:653) ~[?:1.8.0_71] at javax.crypto.Cipher.getInstance(Cipher.java:596) ~[?:1.8.0_71] 解决 通过maven或gradle排除掉不需要的包即可。