Q:

I get an exception java.lang.NoClassDefFoundError when I instantiate a new XPWFDocument object

I have a java program which contains the below code:
try{
    FileInputStream input = new FileInputStream(inputFile);
    XWPFDocument doc = new XWPFDocument(input);
} catch(Exception ex){
    System.out.println("Exception thrown.");
}

in a certain method which has handles the necessary exception with a proper catch statement. However when I run this program I get an error/exception in console as:
Exception in thread "main" java.lang.NoClassDefFoundError: org/openxmlformats/schemas/wordprocessingml/x2006/main/CTHdrFtr

I have downloaded the Apache POI library from this link which is there in this page. (I believe this is the official Apache's POI download page) I am using Eclipse IDE and I've added the library to the build path. Why am I getting this exception? Is there something missing in the library?

A:

The specific class referred to by the exception is contained in poi-ooxml-schemas-3.15-beta2.jar. You must ensure that the 'poi-ooxml-schemas-3.15-beta2.jar' jar file which is contained in the tar.gz is in your build path and will be included in the application's classpath once built. 

