I am new to POI. I am trying to read an xlsx file with the code below in Eclipse:
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class excel {
public static void main(String[] args) throws IOException {
String excelFilePath = "Books.xlsx";
FileInputStream inputStream = new FileInputStream(new File(excelFilePath));
Workbook workbook = new XSSFWorkbook(inputStream);
}
}
but when i run it i get this:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections4/ListValuedMap at excel.main(excel.java:19)
What can I do to stop this error?