Java 错误:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/compress/archivers/zip/ZipFile 解决方法
这个错误是因为缺少 'org.apache.commons.compress.archivers.zip.ZipFile' 类,需要将 'commons-compress' 库添加到项目的类路径中。
如果使用 Maven 管理项目依赖,可以在 'pom.xml' 文件中添加以下依赖:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.19</version>
</dependency>
如果不使用 Maven 管理依赖,可以从官网下载 'commons-compress' 库,并将其添加到项目的类路径中。
原文地址: https://www.cveoy.top/t/topic/oLHL 著作权归作者所有。请勿转载和采集!