piaohao001
piaohao001
2013-03-25 21:28

请教一个关于POI的问题

  • java
  • 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包添加有问题吗,还忘前辈们指导,谢谢。

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐

换一换