MLavrentyev
MLavrentyev

Reputation: 1969

Apache Poi Problems setting up in command line

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:enter image description here:

I am not sure how to add the apache poi library to my program. Thanks!

Upvotes: 0

Views: 1489

Answers (1)

Akash Thakare
Akash Thakare

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

Related Questions