[Java] Check apache poi version

Ref: The Apache POI project – Frequently Asked Questions: My code uses some new feature, compiles fine but fails when live with a “MethodNotFoundException” or “IncompatibleClassChangeError”

    ClassLoader classloader = org.apache.poi.poifs.filesystem.POIFSFileSystem.class.getClassLoader();
    URL res = classloader.getResource("org/apache/poi/poifs/filesystem/POIFSFileSystem.class");
    String path = res.getPath();
    System.out.println("Core POI came from " + path);
This entry was posted in Java. Bookmark the permalink.