使用shade打包后报错Error: A JNI error has occurred, please check your installation and try again_apache

命令行运行发现

使用shade打包后报错Error: A JNI error has occurred, please check your installation and try again_apache_02

原因是因为我使用了一个包来检测文件的编码。

<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-encoding</artifactId>
<version>1.1</version>
</dependency>

这个包里面存在一个工具

<dependency>
<groupId>org.apache.any23</groupId>
<artifactId>apache-any23-encoding</artifactId>
<version>1.1</version>
</dependency>


使用shade打包后报错Error: A JNI error has occurred, please check your installation and try again_命令行_03


使用shade打包后报错Error: A JNI error has occurred, please check your installation and try again_jar包_04

解决方法 把生成的jar包里面的.SF文件去掉就行了。这个方法有点麻烦,我再看看其他方法


哈哈 打包的时候不去弄jar包的签名就行了

使用shade打包后报错Error: A JNI error has occurred, please check your installation and try again_apache_05

参考:​https://www.jianshu.com/p/cd1f1b33a41a">​https://www.jianshu.com/p/cd1f1b33a41a​