编译代码时,我遇到了这些错误:
CreateWorkBook.java:3: error: package poi.org.apache.poi.hssf.usermodel does not exist
import poi.org.apache.poi.hssf.usermodel.HSSFSheet;
^
CreateWorkBook.java:4: error: package poi.org.apache.poi.hssf.usermodel does not exist
import poi.org.apache.poi.hssf.usermodel.HSSFWorkbook;
^
CreateWorkBook.java:13: error: cannot find symbol
HSSFWorkbook workbook = new HSSFWorkbook(file);
^
symbol: class HSSFWorkbook
location: class CreateWorkBook
CreateWorkBook.java:13: error: cannot find symbol
HSSFWorkbook workbook = new HSSFWorkbook(file);
^
symbol: class HSSFWorkbook
location: class CreateWorkBook
CreateWorkBook.java:16: error: cannot find symbol
HSSFSheet sheet = workbook.getSheetAt(0);
^
symbol: class HSSFSheet
location: class CreateWorkBook
CreateWorkBook.java:19: error: cannot find symbol
Iterator<Row> rowIterator = sheet.iterator();
^
symbol: class Iterator
location: class CreateWorkBook
CreateWorkBook.java:19: error: cannot find symbol
Iterator<Row> rowIterator = sheet.iterator();
^
symbol: class Row
location: class CreateWorkBook
CreateWorkBook.java:22: error: cannot find symbol
Iterator<Cell> cellIterator = row.cellIterator();
^
symbol: class Iterator
location: class CreateWorkBook
CreateWorkBook.java:22: error: cannot find symbol
Iterator<Cell> cellIterator = row.cellIterator();
^
symbol: class Cell
location: class CreateWorkBook
CreateWorkBook.java:22: error: cannot find symbol
Iterator<Cell> cellIterator = row.cellIterator();
^
symbol: variable row
location: class CreateWorkBook
10 errors
我该怎么办?我已经在几个地方看过了,但我没有设法纠正这些错误。
我使用:javac CreateWorkBook.java编译我的代码 并使用以下命令运行代码:java CreateWorkBook
(对不起,如果我的英语不好。)