1

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.

1
  • According to the component overview at the POI site, the poi-version jar does not have another other POI dependancies. poi.apache.org/overview.html Commented Oct 21, 2011 at 10:08

2 Answers 2

1

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).

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. I've included every jar mentioned, but I'm still getting the exception: java.lang.reflect.InvocationTargetException
You should ask a new question then, and post the whole stacktrace
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.