<<Back to http://devdoc.net
Mine with nofee-ng to get DevFee back!
Search Apache POI

Apache POI - How To Build

JDK Version

POI 3.11 and later requires the JDK version 1.6 or later.

POI 3.5 to 3.10 required the JDK version 1.5 or later. Versions prior to 3.5 required JDK 1.4+.

Install Apache Ant

The POI build system requires Apache Ant version 1.8 or later

Specifically the build has been tested to work with Ant version 1.8.4 and 1.9.4. To install the product, download the distribution and follow the instructions.

Remember to set the ANT_HOME environment variable and add ANT_HOME/bin to your shell's PATH.

Install Apache Forrest

The POI build system requires Apache Forrest to build the documentation.

Specifically the build has been tested to work with Forrest 0.5. This is an old release which is available here.

Remember to set the FORREST_HOME environment variable.

Building Targets with Ant

The main targets of interest to our users are:

Ant Target Description
clean Erase all build work products (ie. everything in the build directory
compile Compiles all files from main, ooxml and scratchpad
test Run all unit tests from main, ooxml and scratchpad
jar Produce jar files
assemble Produce .zip and tar.gz distribution packages
docs Generate all documentation (Requires Apache Forrest)

Working with Eclipse

Apache POI includes a pre-defined Eclipse project file which can be used to quickly get set up in the Eclipse IDE.

In order to get started, first build Apache POI using Ant as described above to get all required 3rd party libraries downloaded.

Then import the project in Eclipse via File->Import->Existing Projects into Workspace.

Note: when executing junit tests from within Eclipse, you might need to set the system property "POI.testdata.path" to the actual location of the 'test-data' directory to make the test framework find the required test-files. A simple value of 'test-data' usually works.

Using Maven

Build Apache POI using Maven is not currently officially supported, and we strongly suggest continuing to use the official Ant build.

However, including Apache POI within your own Maven project is fully supported, and widely used. Please see the Components Page for details of the Maven artifacts available.

by Glen Stampoultzis, Tetsuya Kitahata, David Fisher