Search code examples
javaexcelmavenapache-poimissing-features

apache poi jar missing class files


I just started using the Apache POI library for dealing with .xls and .xlsx files. I got the poi-ooxml-3.11.jar file from their maven repository and tried the example found here. When implemented in Eclipse, the import for the Row class was not resolved. I have checked the .jar file of the library and indeed under apache.poi.ss.usermodel. there is only one class WorkbookFactory.class. I have tried also previous versions of that POI library but I have stopped at 3.8 seeing that there is nothing in that package. The build path of the project in Eclipse is fine, everything is checked. I tried also with the poi-bin-3.11-20141221.zip library referenced, no success. Even in their library documentation found here that class should be there. Any ideas? Do i have to get the sources and create a jar myself? Any suggestions are appreciated.Thank you.


Solution

  • Apache POI is distributed in various modules, with a main one being poi. Most of the other modules, including poi-ooxml do depend on this main artifact. The dependency is clearly stated in the poi-ooxml POM

    The best thing to do is let Maven handle this, it will automatically pull the needed dependendencies if you add the poi-ooxml one inside your POM.

    If this is not possible, then you will have to replicate the dependency tree by inspecting the POM's of the libraries you need.