0

i tried creating and excel file using this code and its giving me an error of classNotFound please what do i do

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;

public class WorkingwithFile {
    public static void main(String[] args) throws Exception {
        try{
            XSSFWorkbook workbook = new XSSFWorkbook();
            FileOutputStream out = new FileOutputStream(new File("c:/excel.xlsx"));
            XSSFSheet spreasSheet = workbook.createSheet(devnami);
            workbook.write(out);
            out.close();
        }
        catch (Exception e){
            System.out.println(e);
        }

        System.out.println("its been created");
    }
}

open to plenty ideas please

0x1C1B
  • 1,204
  • 11
  • 40
  • Welcome to Stack Overflow! What error message and stacktrace do you get? – werner May 13 '18 at 12:25
  • werner i get this Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections4/ListValuedMap at workingwithfile.workingwithfile.main(workingwithfile.java:24) Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections4.ListValuedMap – JAMES ADAKOLE May 13 '18 at 12:49

0 Answers0