Reprinted from http://blog.csdn.net/szwangdf/article/details/39053859
Currently the latest release of POI is 3.10_final. This version of the jar package is protected by:
Maven Artifactid |
Prerequisites |
JAR |
Poi |
Commons-logging, Commons-codec, log4j |
Poi-version-yyyymmdd.jar |
Poi-scratchpad |
Poi |
Poi-scratchpad-version-yyyymmdd.jar |
Poi-ooxml |
POI, Poi-ooxml-schemas |
Poi-ooxml-version-yyyymmdd.jar |
Poi-ooxml-schemas |
XMLBeans |
Poi-ooxml-schemas-version-yyyymmdd.jar |
Poi-examples |
Poi, Poi-scratchpad, Poi-ooxml |
Poi-examples-version-yyyymmdd.jar |
Ooxml-schemas |
XMLBeans |
Ooxml-schemas-1.1.jar |
A lot of people are confused about the poi so many jars should be imported in the end.
In fact, many times we only use POI to manipulate Excel. Even use the XLS format only.
Then there is no need to import all of them. Please refer to the following for the specific jar package you should use:
Component Map
The Apache POI distribution consists for many document file formats. This are provided in several Jar files. Not all of the Jars is needed for every format. The following tables show the relationships between POI components, Maven repository tags, and the project ' s Jar files.
Component |
Application Type |
Maven Artifactid |
Notes |
Poifs |
OLE2 Filesystem |
Poi |
Required to work with ole2/poifs based files |
Hpsf |
OLE2 Property Sets |
Poi |
|
Hssf |
Excel XLS |
Poi |
For HSSF only, if common SS are needed see below |
Hslf |
PowerPoint PPT |
Poi-scratchpad |
|
Hwpf |
Word DOC |
Poi-scratchpad |
|
Hdgf |
Visio VSD |
Poi-scratchpad |
|
Hpbf |
Publisher PUB |
Poi-scratchpad |
|
Hsmf |
Outlook MSG |
Poi-scratchpad |
|
Openxml4j |
OOXML |
Poi-ooxml Plus one of Poi-ooxml-schemas, Ooxml-schemas |
Only one schemas jar are needed, see below for differences |
Xssf |
Excel XLSX |
Poi-ooxml |
|
Xslf |
PowerPoint PPTX |
Poi-ooxml |
|
Xwpf |
Word DOCX |
Poi-ooxml |
|
Common SS |
Excel XLS and XLSX |
Poi-ooxml |
Workbookfactory and friends all require poi-ooxml, not just core poi |
When we use the XLS format only, we can import Poi-version-yyyymmdd.jar.
When we also want to use the xlsx format, we also import Poi-ooxml-version-yyyymmdd.jar.
As for Poi-ooxml-schemas-version-yyyymmdd.jar, this jar is less likely to be used.
We need to use Poi-scratchpad-version-yyyymmdd.jar when we need to manipulate word, PPT, viso, Outlook, and so on.
Reprint: [Java]poi the role of each jar package