简体   繁体   中英

Where is HWPFDocument located? I can't find it in the POI project

Currently using:

<dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>3.10-FINAL</version></dependency>

I'm trying to write a simple program to get the word count of doc/x files. But some reason it is not able to find that specific method. Is it in another package or something? I've been googling and they are all pointing me to that pom.

As detailed on the Apache POI Components and Dependencies page , for HWPF you also need to include a Maven dependency on the poi-scratchpad artifact.

Your dependency in your pom will need to be something like:

<properties>
  <poi.version>3.11-beta2</poi.version>
 </properties>
<dependencies>
  <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>${poi.version}</version>
  </dependency>
  <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-scratchpad</artifactId>
    <version>${poi.version}</version>
  </dependency>
</dependencies>

(Non maven users need to add the poi-scratchpad jar from the binary package to their classpath, along with the poi jar you add now)

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