这里我试图阅读excel文件,如果想要编辑它 必需的。
//code here
try
{
FileInputStream file = new FileInputStream(new File("howtodoinjava_demo.xlsx"));
//Create Workbook instance holding reference to .xlsx file
XSSFWorkbook workbook = new XSSFWorkbook(file); //ERROR HERE
//Get first/desired sheet from the workbook
XSSFSheet sheet = workbook.getSheetAt(0);
Iterator<Row> rowIterator = sheet.iterator();
while (rowIterator.hasNext())
{
Row row = rowIterator.next();
//For each row, iterate through all the columns
Iterator<Cell> cellIterator = row.cellIterator();
while (cellIterator.hasNext())
{
//code here
}
}
}
块引用 我在这里得到错误
线程中的异常&#34; main&#34; java.lang.NoClassDefFoundError: 组织/阿帕奇/公/ collections4 / ListValuedMap 在com.Edetails.Dao.ReadExcel.main(ReadExcel.java:27) 引起:java.lang.ClassNotFoundException:org.apache.commons.collections4.ListValuedMap at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher $ AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ......还有1个