{"record":{"id":"5749a09e94a413f1","repo":"pxb1988/dex2jar","slug":"cant-find-zipfs-support","errorCode":null,"errorMessage":"cant find zipfs support","messagePattern":"cant find zipfs support","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java","lineNumber":92,"sourceCode":"        if (parent != null && !Files.exists(parent)) {\n            Files.createDirectories(parent);\n        }\n    }\n\n    public static FileSystem createZip(Path output) throws IOException {\n        Map<String, Object> env = new HashMap<>();\n        env.put(\"create\", \"true\");\n        Files.deleteIfExists(output);\n\n        createParentDirectories(output);\n\n        for (FileSystemProvider p : FileSystemProvider.installedProviders()) {\n            String s = p.getScheme();\n            if (\"jar\".equals(s) || \"zip\".equalsIgnoreCase(s)) {\n                return p.newFileSystem(output, env);\n            }\n        }\n        throw new IOException(\"cant find zipfs support\");\n    }\n\n    public static FileSystem openZip(Path in) throws IOException {\n        for (FileSystemProvider p : FileSystemProvider.installedProviders()) {\n            String s = p.getScheme();\n            if (\"jar\".equals(s) || \"zip\".equalsIgnoreCase(s)) {\n                return p.newFileSystem(in, new HashMap<String, Object>());\n            }\n        }\n        throw new IOException(\"cant find zipfs support\");\n    }\n\n    protected static class HelpException extends RuntimeException {\n\n        private static final long serialVersionUID = 5538069795297477488L;\n\n        public HelpException() {\n            super();","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java#L74-L110","documentation":"createZip opens a writable NIO FileSystem over the output jar/zip by looking for an installed FileSystemProvider with scheme 'jar' or 'zip'. If no such provider is registered in this JVM, it throws this IOException instead of creating the archive. The JDK only provides zipfs via the jdk.zipfs module, so this means the runtime lacks that module.","triggerScenarios":"Calling BaseCmd.createZip(Path) (directly or via dex2jar tools that write a jar) on a JVM without zip filesystem support - e.g. a jlink-custom runtime built without jdk.zipfs, an embedded/reduced JRE, or certain limited JVMs like older/alternative runtimes.","commonSituations":"Running dex2jar on a minimal container image built with jlink that omitted jdk.zipfs; using a stripped JVM inside an Android/embedded toolchain; running with a non-OpenJDK runtime that does not ship the jar FileSystemProvider.","solutions":["Run on a full JDK/JRE that includes the jdk.zipfs module (standard OpenJDK builds have it)","If using jlink, rebuild the image with --add-modules jdk.zipfs","Verify with: java --list-modules | grep zipfs, and check providers via FileSystemProvider.installedProviders()","As a workaround, write the zip with java.util.zip.ZipOutputStream instead of the zipfs FileSystem API"],"exampleFix":"// jlink command without zipfs\njlink --add-modules java.base --output minimal-jre\n// after\njlink --add-modules java.base,jdk.zipfs --output minimal-jre","handlingStrategy":"fallback","validationCode":"boolean zipfsSupported() {\n  for (FileSystemProvider p : FileSystemProvider.installedProviders()) {\n    String s = p.getScheme();\n    if (\"jar\".equals(s) || \"zip\".equalsIgnoreCase(s)) return true;\n  }\n  return false;\n}","typeGuard":null,"tryCatchPattern":"try (FileSystem fs = BaseCmd.createZip(out)) { /* write entries */ }\ncatch (IOException e) {\n  if (e.getMessage().contains(\"zipfs support\")) {\n    // fall back to ZipOutputStream-based writer\n  } else throw e;\n}","preventionTips":["Ship/run dex2jar on a full JDK that includes jdk.zipfs","When building jlink images, always add --add-modules jdk.zipfs","Smoke-test FileSystemProvider.installedProviders() in your deployment environment before batch jobs","Prefer standard OpenJDK distributions over trimmed/custom runtimes for conversion tooling"],"tags":["io","java","zipfs","jre-environment"],"backgroundTag":"missing-dependency","analyzedSha":"b5bda4fb4935ae8b3869b422454ae3b3896c7bc1","analyzedAt":"2026-09-08T00:44:01.258Z","contentChangedAt":"2026-09-08T00:44:01.258Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}