大家好我想从java编辑excel表但我的ide找不到“WorkbookFactory”。
InputStream inp = new FileInputStream(filename);
Workbook workbook = WorkbookFactory.create(inp);
Sheet sheet = workbook.getSheetAt(0);
我怎样才能做到这一点?我导入poi-3.17.jar我在JDeveloper 12.2.1.3.0上工作
WorkbookFactory实际上在poi-ooxml-3.17.jar
图书馆。您需要将两者都添加到类路径中。如果您使用的是maven,请使用以下命令:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>