今天执行maven编译的时候,发现jdk抽风,报错了,说error in opening zip file ,导致这个问题的原因是jdk的问题。[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._zipfs.jar; error in opening zip ,我们拷贝一下依赖即可,没啥技术活。

错误问题

[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._jaccess.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._sunjce_provider.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._dnsns.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._nashorn.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._jfxrt.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._sunpkcs11.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._zipfs.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._sunec.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._jaccess.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._sunjce_provider.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._dnsns.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._nashorn.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._jfxrt.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._sunpkcs11.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._zipfs.jar; error in opening zip file
[ERROR] error reading /usr/local/jdk1.8.0_121/jre/lib/ext/._sunec.jar; error in opening zip file

Maven之jdk报错error in opening zip file-yellowcong_ide

解决办法

到ext的目录,然后覆盖一下_xxx.jar的文件,即可解决问题

#进入到ext这个目录
cd /usr/local/jdk1.8.0_121/jre/lib/ext

#强制覆盖一下,即可
\cp  cldrdata.jar          ._cldrdata.jar  
\cp  dnsns.jar             ._dnsns.jar
\cp  jaccess.jar           ._jaccess.jar          
\cp  jfxrt.jar             ._jfxrt.jar          
\cp  nashorn.jar           ._nashorn.jar          
\cp  sunec.jar             ._sunec.jar          
\cp  sunjce_provider.jar   ._sunjce_provider.jar           
\cp  sunpkcs11.jar         ._sunpkcs11.jar          
\cp  zipfs.jar             ._zipfs.jar 
\cp  localedata.jar        ._localedata.jar