我想创建excel文件并使用java程序在该文件中写入数据。
就是在这里,我在存在 java 文件的位置提取了 Apache POI。并将该路径包含在路径变量中。
当我尝试编译它时给出以下错误:
data.java:3: package org.apache.poi.hssf.usermodel does not exist
import org.apache.poi.hssf.usermodel.HSSFCell;
^
data.java:4: package org.apache.poi.hssf.usermodel does not exist
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
^
data.java:5: package org.apache.poi.hssf.usermodel does not exist
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
^
data.java:6: package org.apache.poi.hssf.usermodel does not exist
import org.apache.poi.hssf.usermodel.HSSFRow;
^
data.java:7: package org.apache.poi.hssf.usermodel does not exist
import org.apache.poi.hssf.usermodel.HSSFSheet;
^
data.java:8: package org.apache.poi.hssf.usermodel does not exist
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
^
data.java:11: package org.apache.poi.hssf.usermodel does not exist
import org.apache.poi.hssf.usermodel.HSSFFont;
^
data.java:12: package org.apache.poi.ss.usermodel does not exist
import org.apache.poi.ss.usermodel.IndexedColors;
^
这是 Poi 文件列表。在这个列表中我必须包括哪一个?
root@:[/u01/isac/code/CWSA/isac/java/exportAPI/poi-3.9]
$ ll
total 9044
-rw-r--r-- 1 root root 27138 Nov 25 15:23 LICENSE
-rw-r--r-- 1 root root 890 Nov 25 15:23 NOTICE
drwxr-xr-x 16 root root 4096 Nov 26 17:22 docs
drwxr-xr-x 2 root root 4096 Nov 26 17:22 lib
drwxr-xr-x 2 root root 4096 Nov 26 17:22 ooxml-lib
-rw-r--r-- 1 root root 1869113 Nov 26 17:22 poi-3.9-20121203.jar
-rw-r--r-- 1 root root 309368 Nov 26 17:22 poi-examples-3.9-20121203.jar
-rw-r--r-- 1 root root 30446 Nov 26 17:22 poi-excelant-3.9-20121203.jar
-rw-r--r-- 1 root root 936648 Nov 26 17:22 poi-ooxml-3.9-20121203.jar
-rw-r--r-- 1 root root 4802621 Nov 26 17:22 poi-ooxml-schemas-3.9-20121203.jar
-rw-r--r-- 1 root root 1226511 Nov 26 17:22 poi-scratchpad-3.9-20121203.jar