javaapache-poi

Java POI cannot find symbol WorkbookFactory


im doing a conversion of the HSSF model to XSSF. Im getting lil errors here and there. I donwloaded the latest POI and dropped all the jar files in and did the apache includes in my java class.....getting this error:

import org.apache.poi.ss.usermodel.Workbook;

Workbook wb = WorkbookFactory.create();

275: cannot find symbol [javac] symbol : variable WorkbookFactory [javac] location: class mil.usmc.logcom.chassis.util.HSSFUtils [javac] Workbook wb = WorkbookFactory.create();


Solution

  • There is no zero-arg method for WorkbookFactory.create(). For example:

    InputStream inp = new FileInputStream("workbook.xlsx");
    Workbook wb = WorkbookFactory.create(inp);