简体   繁体   English

版本3.13中缺少Apache POI hslf?

[英]Apache POI hslf missing from release 3.13?

I'm trying to make an PPT(X) presentation from java code. 我正在尝试从Java代码制作PPT(X)演示文稿。 I've downloaded apache poi 3.13 release from official site . 我已经从官方网站下载了apache poi 3.13版本。 I've added a binary to my class path and now when I'm trying to create a presentation - it fails to compile. 我已经将二进制文件添加到类路径中,现在当我尝试创建演示文稿时-它无法编译。

It seems like package referenced 好像包被引用了

import org.apache.poi.hslf.model;

is not found. 找不到。 However, 然而,

import org.apache.poi.hssf.usermodel.HSSFWorkbook;

is working fine and I able to create an Excel spreadsheet file. 工作正常,我可以创建一个Excel电子表格文件。

As explained in the cunningly titled Apache POI Components Map , in order to use HSLF you need both the core POI jar and the POI Scratchpad jar 如题为“ Apache POI Components Map ”的狡猾解释,要使用HSLF您既需要核心POI jar 也需要POI Scratchpad jar

If using Maven, you'd add a dependency of 如果使用Maven,则需要添加一个依赖项

<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi-scratchpad</artifactId>
  <version>3.13</version>
</dependency>

(Or add one on the OOXML component, that'll currently pull the scratchpad in too) (或在OOXML组件上添加一个组件,该组件当前也将暂存器拉入)

If you're using the Apache POI binary download , add both the poi-#.###.jar file and the poi-scratchpad-#.###.jar file to your classpath 如果您正在使用Apache POI二进制下载文件 ,请将poi-#.###.jar文件和poi-scratchpad-#.###.jar文件都添加到类路径中

Have you tried this dependency: 您是否尝试过这种依赖关系:

<dependency>
 <groupId>org.apache.poi</groupId>
 <artifactId>poi-ooxml</artifactId>
 <version>3.13</version>
</dependency>

or just "poi" as artifactId? 还是“ poi”作为artifactId? I had the same issue and changing the dependency solved the issue. 我遇到了同样的问题,更改依赖关系解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM