亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為何Excel高版本會報NoClassDef?各種包也都引入了?

http://img1.sycdn.imooc.com//591c76ed0001a07707490151.jpg

http://img1.sycdn.imooc.com//591c76ee0001170603750370.jpg

String[] title = {"id", "name", "gender"};

第21行: XSSFWorkbook workbook = new XSSFWorkbook();

Sheet sheet = workbook.createSheet();

Row row = sheet.createRow(0);

Cell cell = null;

for (int i=0; i< title.length; i++){

cell = row.createCell(i);

cell.setCellValue(title[i]);

}

//Insert 10 records?

for (int i=1; i<10; i++){

Row nextrow = sheet.createRow(i);

cell=nextrow.createCell(0);

cell.setCellValue("a"+ i);

cell=nextrow.createCell(1);

cell.setCellValue("AI#" + i);

cell=nextrow.createCell(2);

cell.setCellValue("Male");

}

//Write the records into xls file

File file = new File("C:/eclipse/test_new.xlsx");

try {

file.createNewFile();

FileOutputStream stream = FileUtils.openOutputStream(file);

workbook.write(stream);

stream.close();

workbook.close();

System.out.println("Export Sucessfully!");

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}


正在回答

1 回答

就是有jar包沒有找到,找找看是不是有遺漏了


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為何Excel高版本會報NoClassDef?各種包也都引入了?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號