{"record":{"id":"e54562da717fb34e","repo":"pxb1988/dex2jar","slug":"cant-find-zipfs-support-e54562","errorCode":null,"errorMessage":"cant find zipfs support","messagePattern":"cant find zipfs support","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2jar.java","lineNumber":304,"sourceCode":"            }\n        }\n    }\n\n    private static FileSystem createZip(Path output) throws IOException {\n        Map<String, Object> env = new HashMap<>();\n        env.put(\"create\", \"true\");\n        Files.deleteIfExists(output);\n        Path parent = output.getParent();\n        if (parent != null && !Files.exists(parent)) {\n            Files.createDirectories(parent);\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 Dex2jar withExceptionHandler(DexExceptionHandler exceptionHandler) {\n        this.exceptionHandler = exceptionHandler;\n        return this;\n    }\n\n    public Dex2jar skipExceptions(boolean b) {\n        if (b) {\n            this.readerConfig |= DexFileReader.SKIP_EXCEPTION;\n        } else {\n            this.readerConfig &= ~DexFileReader.SKIP_EXCEPTION;\n        }\n        return this;\n    }\n}\n","sourceCodeStart":286,"sourceCodeEnd":321,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2jar.java#L286-L321","documentation":"Dex2jar writes its output jar via the JDK's NIO zip filesystem provider. createZip scans installed FileSystemProviders for one whose scheme is 'jar' or 'zip'; if none is found it means the JVM's zipfs provider is missing and it throws this IOException instead of returning a FileSystem.","triggerScenarios":"Calling Dex2jar.to(...) (or any method that invokes createZip) on a JVM where the jdk.zipfs module is not present/enabled, e.g. a stripped custom runtime image (jlink) built without jdk.zipfs.","commonSituations":"Running dex2jar on a minimal JRE or jlink-trimmed runtime lacking jdk.zipfs; using exotic JVMs (some embedded/Android-art JVMs, very old or non-OpenJDK runtimes) without the NIO zip filesystem provider; module restrictions added via --limit-modules.","solutions":["Run on a full JDK/JRE 8+ that includes the jdk.zipfs module (standard OpenJDK/Oracle builds include it)","If using jlink, include jdk.zipfs: add it to --add-modules when creating the runtime image","Remove --limit-modules or module restrictions that exclude jdk.zipfs","As a workaround, patch/fork createZip to fall back to java.util.zip ZipOutputStream for writing the output jar"],"exampleFix":"// before (jlink image without zipfs)\njlink --add-modules java.base --output minrt\n// after\njlink --add-modules java.base,jdk.zipfs --output minrt","handlingStrategy":"try-catch","validationCode":"boolean zipfsAvailable = FileSystemProvider.installedProviders().stream()\n    .anyMatch(p -> \"jar\".equals(p.getScheme()) || \"zip\".equalsIgnoreCase(p.getScheme()));\nif (!zipfsAvailable) throw new IllegalStateException(\"JVM lacks zipfs provider; use a full JDK/JRE with jdk.zipfs\");","typeGuard":null,"tryCatchPattern":"try {\n    dex2jar.to(file);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"cant find zipfs support\")) {\n        // fall back to java.util.zip-based writer or fail with actionable message\n    } else {\n        throw e;\n    }\n}","preventionTips":["Run dex2jar on a standard OpenJDK/Oracle JDK 8+ build","When building jlink images, always include jdk.zipfs","Avoid --limit-modules settings that drop jdk.zipfs"],"tags":["java","zipfs","filesystem","runtime-environment"],"backgroundTag":"unsupported-platform","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"}