You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by jzfwang <jz...@gmail.com> on 2018/09/30 21:05:06 UTC

new to POI, help needed!!

I wrote a very short code to use POI, but failed.  Help is greatly
appreciated!

I could not even run this short codes.  

I have downloaded the newest version of Apache files, including:
poi-4.0.jar, poi-ooxml-4.0.0.jar; poi-ooxml-schemas-4.0.0.jar,
xmlbeans-3.0.1.jar, and commons-collection4-4.2.jar
------------------------------------------------------------------
import java.io.FileInputStream;
import java.io.IOException;

import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

public class POIExcel {

public static void main(String[] args) throws IOException {
FileInputStream fis = new
FileInputStream("C:/Users/xxxx/Desktop/Input.xlsx");

Workbook wb = new XSSFWorkbook(fis);
--------------------------------------------------------
Here is the error message:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/compress/archivers/zip/ZipFile
	at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:298)
	at org.apache.poi.ooxml.util.PackageHelper.open(PackageHelper.java:37)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:307)
	at TestNG_Project.POIExcel.main(POIExcel.java:14)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.compress.archivers.zip.ZipFile
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 4 more





--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: new to POI, help needed!!

Posted by Andreas Reichel <an...@manticore-projects.com>.
On Sun, 2018-09-30 at 14:05 -0700, jzfwang wrote:
> org.apache.commons.compress

You need that library, which is (for any reason) not part of the poi-
package.

Best regards

Re: new to POI, help needed!!

Posted by meetmadhuri85 <me...@gmail.com>.
Hi ,
I am also getting the same issue
I tried downloading the  binary version of files from above location and
added jars to the project.
But no luck!!



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: new to POI, help needed!!

Posted by "pj.fanning" <fa...@yahoo.com>.
https://commons.apache.org/proper/commons-compress/download_compress.cgi -
download v1.18



--
Sent from: http://apache-poi.1045710.n5.nabble.com/POI-User-f2280730.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org