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