java.lang.NoClassDefFoundError while creating a .xlsx file using Apache POI

前端 未结 5 614
伪装坚强ぢ
伪装坚强ぢ 2021-01-23 16:21

I am trying to create a .xlsx file using Apache POI. This is my code:

FileOutputStream outputStream1=null;
XSSFWorkbook workbook = new XSSFWorkbook();
XSSFSheet          


        
5条回答
  •  走了就别回头了
    2021-01-23 17:06

    In my case, it works only if your app contains these libraries:

    compile files('libs/dom4j-1.6.1.jar')
    compile files('libs/stax-api-1.0.1.jar')
    compile files('libs/xmlbeans-2.6.0.jar')
    compile files('libs/poi-3.10.1-20140818.jar')
    compile files('libs/poi-ooxml-3.10.1-20140818.jar')
    compile files('libs/poi-ooxml-schemas-3.10.1-20140818.jar')
    

    You can download them here: here, all in the 'poi-bin-3.10.1-20140818.zip' archive.

    And please do not try to install a newer version, it will not work (at least for Android), only 3.10.1 and lower.

提交回复
热议问题