importing Apache POI Java

牧云@^-^@ 提交于 2019-12-25 04:47:22

问题


Hi I'm having a bit of trouble using the Apache POI library in java. I've downloaded and imported the library into my project, but am unable to import it into my java class. (like you would do):

import java.awt.*;

Am I looking at this the wrong way, or am I missing something?


回答1:


If you are using maven, map de dependecies:

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.14</version>
</dependency>

Then import and use the apache poi library:

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
//..
FileInputStream file = new FileInputStream(new File("C:\\test.xls"));


来源:https://stackoverflow.com/questions/39600408/importing-apache-poi-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!