package Data_Recovery;import javaioFile;import javaioFileInputStream;import javaioFileOutputStream;import javaioIOException;import javatimeLocalDate;import javatimetemporalChronoUnit;import javautilIt
这些错误是因为POI库的版本问题导致的。getColumnIterator()方法和getLocalDateTimeCellValue()方法在旧版本的POI库中是不存在的。
解决办法是更新POI库到最新版本。可以在Maven项目中的pom.xml文件中添加以下依赖项:
<dependencies>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
然后重新编译和运行代码。这样应该就能解决这些错误了。
原文地址: https://www.cveoy.top/t/topic/ijW6 著作权归作者所有。请勿转载和采集!