ZipSecureFile$ThresholdInputStream cannot be cast to java.base/java.util.zip.ZipFile$ZipFileInputStream

使用apache.poi导出excel文件的时候会报这个错误

 Caused by: java.lang.ClassCastException: 
org.apache.poi.openxml4j.util.ZipSecureFile$ThresholdInputStream cannot be cast to java.base/java.util.zip.ZipFile$ZipFileInputStream

百度之后发现只有一条有用的链接。

https://bz.apache.org/bugzilla/show_bug.cgi?id=62187

然后检查IDEA的使用的是JAVA11。我原来的项目是用eclipse开发的 使用的是本机的java8。

所以切换IDEA的JDK为 java8后问题得到解决。

 

原文地址:https://www.cnblogs.com/CryOnMyShoulder/p/12783292.html