在java WorkbookFactory中编辑excel

问题描述 投票:0回答:1

大家好我想从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上工作

java excel apache-poi
1个回答
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>
© www.soinside.com 2019 - 2024. All rights reserved.