问题
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