简体   繁体   中英

Apache POI hslf missing from release 3.13?

I'm trying to make an PPT(X) presentation from java code. I've downloaded apache poi 3.13 release from official site . 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.

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

If using Maven, you'd add a dependency of

<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)

If you're using the Apache POI binary download , add both the poi-#.###.jar file and the poi-scratchpad-#.###.jar file to your classpath

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? I had the same issue and changing the dependency solved the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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