我试了一下,没有问题
先问一下,你用的JDK是什么版 本。我是1.6_20,直接用你的程序。
zipFile = new ZipFile(new File(zipfile),"GBK");
Enumeration enumeration = zipFile.getEntries();
是报错的。
我改成了
zipFile = new ZipFile(new File(zipfile));
Enumeration enumeration = zipFile.entries();
这应该不是主要问题。
有没有可能是你的压缩包损坏了。或是包里的那个文件坏了,跟一下断点,看一下是解那个文件出的错。