SpongeHAO 发表于 2013-03-25 21:07

请教一个关于POI的问题

代码如下:
import java.io.FileOutputStream;
import java.io.IOException;
//import org.apache.poi.hssf.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;

public class ex1 {
        public static void main(String[] args) throws IOException {
                // 创建一个excel文件
                Workbook wb = new HSSFWorkbook();
          FileOutputStream fileOut = new FileOutputStream("C://workbook.xlsx");
          wb.write(fileOut);
          fileOut.close();
        }
}

运行环境是Myeclipse,始终报错:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
        HSSFWorkbook cannot be resolved to a type
        HSSFWorkbook cannot be resolved to a type

        at ex1.main(ex1.java:10)

是我的外部jar包添加有问题吗,还忘前辈们指导,谢谢。
页: [1]
查看完整版本: 请教一个关于POI的问题