what all are the jar dependencies for apache POI for read and write to excel or xls?

前端 未结 2 565
故里飘歌
故里飘歌 2021-01-25 22:18

i am getting runtime with error like java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlObject because of missing xmlbeans.jar dependency. i need to work with XLS, DOC and .

相关标签:
2条回答
  • 2021-01-25 23:12

    The dependencies of Apache POI are fully described on the Apache POI website here.

    That table (which I won't reproduce here as you'll want to check the latest version on the POI website) details, for each component you want to use, what the dependencies are.

    If you download the latest Apache POI binary release (.tar.gz or .zip), you'll find all the dependency jars you need contained within that. Check the components and dependencies page to see which ones you'll need for your use.

    Alternately, manually handling dependencies is rather 1990s. You'd be much better off using a tool like Gradle or Apache Maven to handle it for you, then they'll pick up the project-supplied metadata to grab the dependencies you need.

    Detail of the Maven / Gradle artifacts for Apache POI are also given on the Components page on the POI website

    0 讨论(0)
  • 2021-01-25 23:14

    For Apache POI you need these two combination.

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.12</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.12</version>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题