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

前端 未结 5 668
伪装坚强ぢ
伪装坚强ぢ 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 16:56

    As detailed on the Apache POI components page, to use the OOXML code like XSSF, you need both the poi and poi-ooxml jars on your classpath, along with their dependencies.

    The latest version of Apache POI, as of writing, is 3.10. I'd suggest you go download the binary release package, in there you'll find all the POI jars, along with all their dependencies. The components page will help you work out which you need, but for working with XSSF the short answer is you'll basically need all of them!

提交回复
热议问题