1

I am extracting zip file through java code, But its giving below exception.## Heading ##

java.util.zip.ZipException: invalid entry CRC (expected 0x0 but got 0xc86c27fe)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:221)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at zipExtraction.UnZip.unZipIt(UnZip.java:60)
at zipExtraction.UnZip.main(UnZip.java:20)

Can anyone tell me the reason, why i am getting this error.

Deepak Talape
  • 917
  • 8
  • 30

1 Answers1

2

it probably means that one of your JAR files is bad (JAR files are just ZIP files).

You can login via SSH then go to the directory containing the jars and run:

for a in `ls *.jar`; do unzip -qq -t $a &>/dev/null; if [ $? -ne 0 ]; then echo "$a"; fi;

This will test the jars and print the ones with errors.

Lier
  • 206
  • 3
  • 16
  • What do you mean by--- You can login via SSH then go to the directory containing the jars and run: Can you please elaborate the answer. – Deepak Talape Jan 30 '17 at 10:06
  • 1
    @DeepakTalape Maybe it's a copy and paste from here. http://www.jvmhost.com/articles/what-is-java-util-zipexception-invalid-entry-crc – SubOptimal Jan 30 '17 at 11:05