Reputation: 1419
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.
Upvotes: 2
Views: 2704
Reputation: 48376
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
Upvotes: 3
Reputation: 482
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.
Upvotes: 0