Reputation: 1969
I am trying to make use of Apache-Poi for a program I am working on, but I recently ran into problems trying to actually implement it. I downloaded the files, and unzipped them, but my program won't recognize it. I have:
To describe my dependencies::
I am not sure how to add the apache poi library to my program. Thanks!
Upvotes: 0
Views: 1489
Reputation: 22974
You can specify your apache-poi
jar as follow.
C:/demo/myprogram>javac -cp C:/project/jars/apache-poi.jar Main.java
C:/demo/myprogram>java -cp C:/project/jars/apache-poi.jar. Main
Here we specify the jar to classpath during the compilation and execution,in this way you will be able to access the apache-poi
classes.
If you want to add multiple jars you can use *
for that,
java -cp C:/project/jars/*. Main
Upvotes: 2