1
votes

I am reading .xls and .xlsx using Apache POI through Java.

I have included below jars to my classpath:

 1. poi-3.7-20101029.jar
 2. poi-examples-3.7-20101029.jar
 3. poi-ooxml-3.7-20101029.jar
 4. poi-ooxml-schemas-3.7-20101029.jar
 5. poi-scratchpad-3.7-20101029.jar

Are all jars required to read/write data from/to xls/xlsx files? I think I can exclude poi-examples-3.7-20101029.jar as the name suggests it contains examples. I tried that and it works (I am able read from xls/xlsx). What is the minimal set of jars required to read/write data from/to xls/xlsx files?

I want to keep my project size as small as possible, so appreciate if anyone can focus on this.

2
According to the component overview at the POI site, the poi-version jar does not have another other POI dependancies. poi.apache.org/overview.htmlJohn B

2 Answers

1
votes

I think poi-3.7-20101029.jar is enough. :)

1
votes

If you just want to read/write XLS files, then all you need is the main POI jar. If you want to read/write XLSX files, then you also need the two OOXML jars (plus appropriate XML parser dependencies)

You wouldn't normally need to include the examples Jar. The scratchpad jar is needed for PPT, DOC, VSD etc, along with a small number of experimental XLS features (such as charts).