Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

POI API APACHE importing to netbeans

I have read some tips in here but i still cant do import like this:

import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;

I have add the zip file (poi-src-3.8-20120326) that downloaded from here to library inmy neatbeans project.

like image 227
Ahimsa Afrizal Avatar asked May 28 '26 10:05

Ahimsa Afrizal


2 Answers

Unzip the file you downloaded, find: poi-3.8-20120326.jar, open NetBeans project, find Libraries, right click on it and select Add JAR/Folder, select the poi-3.8-20120326.jar and thats it. When you do that you can use classes from poi-3.8-20120326.jar. This jar will be on your classpath.

Notice that in the unzipped directory there is also lib folder, these are the dependencies for poi, make sure you add them as well.

like image 89
Paulius Matulionis Avatar answered May 31 '26 07:05

Paulius Matulionis


You will need the compiled code on the class path. Rather than just the source code. Typically projects distribute these separately.

Take a look into using maven to automatically download dependencies and source for external projects such as poi.

Get the compile working outside of netbeans. Only then open it in net beans.

like image 35
Tinman Avatar answered May 31 '26 06:05

Tinman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!