java.util.zip.ZipException: error in opening zip file

JDK Bug System | Erik Larsen | 9 years ago
  1. 0

    [JDK-6599383] Unable to open zip files more than 2GB in size - Java Bug System

    java.net | 12 months ago
    java.util.zip.ZipException: error in opening zip file
  2. 0

    Bug ID: JDK-6599383 Unable to open zip files more than 2GB in size

    java.com | 9 months ago
    java.util.zip.ZipException: error in opening zip file
  3. 0

    OPERATING SYSTEM(S): All FULL JDK VERSION(S): java version "1.6.0_02" Java(TM) SE Runtime Environment (build 1.6.0_02-b06) Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode) DESCRIPTION: When JDK 6 is used for unzipping a zip file > 2GB in size, the following exception is thrown: java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:114) at java.util.zip.ZipFile.<init>(ZipFile.java:75) at UnZip.main(UnZip.java:65) Exact steps to reproduce 1. Create a zip file > 2GB in size. 2. Write a simple java program to unzip the file using a Java program The following testcase was obtained from another sun bug: import java.io.*; import java.util.*; import java.util.zip.*; public class unzip { public static final void copyInputStream (InputStream in,OutputStream out) throws IOException { byte[] buffer = new byte [1024]; int len; while ((len = in.read(buffer)) >= 0) out.write(buffer, 0, len); in.close(); out.close(); } public static final void main (String[] args) { Enumeration entries; ZipFile zipFile=null; if (args.length != 1){ System.err.println("Usage: Unzip zipfile"); return; } try{ zipFile = new ZipFile(args[0]); }catch(IOException ioe){System.out.println("error opening the zipfile");ioe.printStackTrace();} ZipEntry entry=null; entries = zipFile.entries(); while (entries.hasMoreElements()){ System.out.println("Constructing ZipFile..."); entry = ( ZipEntry ) entries.nextElement(); } if (entry.isDirectory()){ // Assume directories are stored parents first then children System.err.println("Extracting directory: " + entry.getName()); // This is not robust, just for demonstration purposes. (new File(entry.getName())).mkdir(); //continue; } System.err.println("Extracting file: " + entry.getName()); try{ copyInputStream(zipFile.getInputStream(entry),new BufferedOutputStream(new FileOutputStream(entry.getName()))); System.out.print("Check memory usage and press 'Enter'..."); System.in.read(); zipFile.close(); }catch(IOException ioe){ioe.printStackTrace();} } }

    JDK Bug System | 9 years ago | Erik Larsen
    java.util.zip.ZipException: error in opening zip file
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    OPERATING SYSTEM(S): All FULL JDK VERSION(S): java version "1.6.0_02" Java(TM) SE Runtime Environment (build 1.6.0_02-b06) Java HotSpot(TM) Client VM (build 1.6.0_02-b06, mixed mode) DESCRIPTION: When JDK 6 is used for unzipping a zip file > 2GB in size, the following exception is thrown: java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:114) at java.util.zip.ZipFile.<init>(ZipFile.java:75) at UnZip.main(UnZip.java:65) Exact steps to reproduce 1. Create a zip file > 2GB in size. 2. Write a simple java program to unzip the file using a Java program The following testcase was obtained from another sun bug: import java.io.*; import java.util.*; import java.util.zip.*; public class unzip { public static final void copyInputStream (InputStream in,OutputStream out) throws IOException { byte[] buffer = new byte [1024]; int len; while ((len = in.read(buffer)) >= 0) out.write(buffer, 0, len); in.close(); out.close(); } public static final void main (String[] args) { Enumeration entries; ZipFile zipFile=null; if (args.length != 1){ System.err.println("Usage: Unzip zipfile"); return; } try{ zipFile = new ZipFile(args[0]); }catch(IOException ioe){System.out.println("error opening the zipfile");ioe.printStackTrace();} ZipEntry entry=null; entries = zipFile.entries(); while (entries.hasMoreElements()){ System.out.println("Constructing ZipFile..."); entry = ( ZipEntry ) entries.nextElement(); } if (entry.isDirectory()){ // Assume directories are stored parents first then children System.err.println("Extracting directory: " + entry.getName()); // This is not robust, just for demonstration purposes. (new File(entry.getName())).mkdir(); //continue; } System.err.println("Extracting file: " + entry.getName()); try{ copyInputStream(zipFile.getInputStream(entry),new BufferedOutputStream(new FileOutputStream(entry.getName()))); System.out.print("Check memory usage and press 'Enter'..."); System.in.read(); zipFile.close(); }catch(IOException ioe){ioe.printStackTrace();} } }

    JDK Bug System | 9 years ago | Erik Larsen
    java.util.zip.ZipException: error in opening zip file
  6. 0

    EPM 11.1.2.1 Installaion issue

    Oracle Community | 5 years ago | PrakashV
    java.util.zip.ZipException: error in opening zip file

  1. davidvanlaatum 64 times, last 2 months ago
  2. davidvanlaatum 89 times, last 1 month ago
  3. Mihail Melnic 1 times, last 6 months ago
  4. Roberto Tomás 441 times, last 8 months ago
  5. martyn 1 times, last 8 months ago
2 more registered users
25 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.util.zip.ZipException

    error in opening zip file

    at java.util.zip.ZipFile.open()
  2. Java RT
    ZipFile.<init>
    1. java.util.zip.ZipFile.open(Native Method)
    2. java.util.zip.ZipFile.<init>(ZipFile.java:114)
    3. java.util.zip.ZipFile.<init>(ZipFile.java:75)
    3 frames
  3. Unknown
    UnZip.main
    1. UnZip.main(UnZip.java:65)
    1 frame