Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What can be the problem cause ?

 
Muhammad Asif
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to Extract a zip file!
When I try to open the file using
ZipFile zFile = new ZipFile(zipFile);
i get the following exception :
java.util.zip.ZipException: error in opening zip file
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.io.IOException(java.lang.String)
java.util.zip.ZipException (java.lang.String)
long java.util.zip.ZipFile.open(java.lang.String)
java.util.zip.ZipFile(java.lang.String)
java.util.zip.ZipFile(java.io.File)
Can some one figure out the problem ???
And one more thing,
I am able to open the zip file using WinZip without ne problems!
Regards
Muhammad Asif Abbasi
 
Karl Laird
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The unfortunate problem here is that java Zip is incompatible with regular Zip algorithms.
You can only open Zip files that have been made by a java Zip file writer - not Winzip archives.
Hopefully this will be corrected in a later version of the JDK
 
Snigdha Solanki
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of JDK are you using? In JDK 1.3 it
is possible to open zip files which are created using Winzip or any other archiving tool. I am not sure about older versions but your program should work fine on JDK1.3.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic