{
  "id": "java/zip-file-open-error",
  "signature": "java.util.zip.ZipException: error in opening zip file",
  "signature_zh": "java.util.zip.ZipException：打开zip文件时出错",
  "regex": "java\\.util\\.zip\\.ZipException: error in opening zip file",
  "domain": "java",
  "category": "io_error",
  "subcategory": null,
  "root_cause": "The JVM or application attempted to open a ZIP or JAR file that is corrupted, truncated, or not a valid ZIP format, often due to incomplete downloads, disk errors, or file system corruption.",
  "root_cause_type": "generic",
  "root_cause_zh": "JVM或应用程序尝试打开一个损坏、截断或不是有效ZIP格式的ZIP或JAR文件，通常是由于下载不完整、磁盘错误或文件系统损坏。",
  "versions": [
    {
      "version": "Java 8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 17",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Java 21",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Re-download the ZIP file using the same URL without verifying integrity",
      "why_fails": "If the source server or network path is unreliable, re-downloading the same file may still result in a corrupted copy. Without checksum validation (e.g., MD5 or SHA-256), the corruption persists.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase JVM memory with -Xmx",
      "why_fails": "Memory settings do not affect the ability to open a corrupted ZIP file. The error is a file integrity issue, not a memory allocation problem.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Verify the ZIP file integrity using `unzip -t <file.zip>` (Linux/macOS) or `jar -tf <file.jar>` (Java). If it reports errors, obtain a fresh copy from the original source and compare checksums: `sha256sum <file.zip>`.",
      "success_rate": 0.9,
      "how": "Verify the ZIP file integrity using `unzip -t <file.zip>` (Linux/macOS) or `jar -tf <file.jar>` (Java). If it reports errors, obtain a fresh copy from the original source and compare checksums: `sha256sum <file.zip>`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the file is a Maven/Gradle dependency, clear the local repository cache: `rm -rf ~/.m2/repository/<group>/<artifact>` (Maven) or `rm -rf ~/.gradle/caches/` (Gradle), then rebuild the project to force re-download.",
      "success_rate": 0.85,
      "how": "If the file is a Maven/Gradle dependency, clear the local repository cache: `rm -rf ~/.m2/repository/<group>/<artifact>` (Maven) or `rm -rf ~/.gradle/caches/` (Gradle), then rebuild the project to force re-download.",
      "condition": "",
      "sources": []
    },
    {
      "action": "For JAR files in the classpath, check file permissions: `ls -l <file.jar>` and ensure the application user has read access. Use `chmod +r <file.jar>` to fix permissions if needed.",
      "success_rate": 0.75,
      "how": "For JAR files in the classpath, check file permissions: `ls -l <file.jar>` and ensure the application user has read access. Use `chmod +r <file.jar>` to fix permissions if needed.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Verify the ZIP file integrity using `unzip -t <file.zip>` (Linux/macOS) or `jar -tf <file.jar>` (Java). If it reports errors, obtain a fresh copy from the original source and compare checksums: `sha256sum <file.zip>`.",
    "If the file is a Maven/Gradle dependency, clear the local repository cache: `rm -rf ~/.m2/repository/<group>/<artifact>` (Maven) or `rm -rf ~/.gradle/caches/` (Gradle), then rebuild the project to force re-download.",
    "For JAR files in the classpath, check file permissions: `ls -l <file.jar>` and ensure the application user has read access. Use `chmod +r <file.jar>` to fix permissions if needed."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/zip/ZipException.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2023-01-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}