{"record":{"id":"170820c64cb5fa60","repo":"pxb1988/dex2jar","slug":"version-not-support-yet","errorCode":null,"errorMessage":"version not support yet!","messagePattern":"version not support yet!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"dex-tools/src/main/java/com/googlecode/dex2jar/tools/ClassVersionSwitch.java","lineNumber":39,"sourceCode":"            Opcodes.V1_1,\r\n            Opcodes.V1_2,\r\n            Opcodes.V1_3,\r\n            Opcodes.V1_4,\r\n            Opcodes.V1_5,\r\n            Opcodes.V1_6,\r\n            Opcodes.V1_7,\r\n            52,\r\n            53,\r\n    };\r\n\r\n    public static void main(String... args) throws IOException {\r\n        if (args.length < 3) {\r\n            System.out.println(\"Usage: clz-version-switch version old.jar new.jar\");\r\n            System.exit(1);\r\n        }\r\n        int version = Integer.parseInt(args[0]);\r\n        if (version < 1 || version > 9) {\r\n            throw new RuntimeException(\"version not support yet!\");\r\n        }\r\n        File old = new File(args[1]);\r\n        File n = new File(args[2]);\r\n        byte[] buff = new byte[1024 * 50];\r\n        final int jVersion = jVersions[version];\r\n        try (ZipFile zip = new ZipFile(old); ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(n));) {\r\n\r\n            for (Enumeration<? extends ZipEntry> e = zip.entries(); e.hasMoreElements(); ) {\r\n                ZipEntry zipEntry = e.nextElement();\r\n                zos.putNextEntry(new ZipEntry(zipEntry.getName()));\r\n                if (!zipEntry.isDirectory()) {\r\n                    try (InputStream is = zip.getInputStream(zipEntry)) {\r\n                        if (zipEntry.getName().endsWith(\".class\")) {\r\n                            ClassReader cr = new ClassReader(is);\r\n                            ClassWriter cw = new ClassWriter(0);\r\n                            ClassVisitor cv = new ClassVisitor(Opcodes.ASM9, cw) {\r\n                                @Override\r\n                                public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {\r","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-tools/src/main/java/com/googlecode/dex2jar/tools/ClassVersionSwitch.java#L21-L57","documentation":"ClassVersionSwitch's CLI accepts a version index 1-9 which it maps into an actual Java class-file major version via the jVersions table. Any number outside 1..9 has no table entry, so it throws this immediately after parsing args.","triggerScenarios":"Running `clz-version-switch <version> old.jar new.jar` with a first argument that parses to an integer outside 1-9 (e.g. 0, 10, negative, or a raw Java version like 52).","commonSituations":"Users passing the actual class-file major version (45-69) instead of the tool's 1-9 index, or typos.","solutions":["Pass an index between 1 and 9 corresponding to the Java version (see jVersions mapping in the tool)","Check the tool usage output: `clz-version-switch version old.jar new.jar`","If you need a version outside the 1-9 table, extend jVersions and the bounds check in ClassVersionSwitch.java:39"],"exampleFix":"// before\nclz-version-switch 52 old.jar new.jar\n// after\nclz-version-switch 4 old.jar new.jar","handlingStrategy":"validation","validationCode":"int v = Integer.parseInt(args[0]);\nif (v < 1 || v > 9) throw new IllegalArgumentException(\"version index must be 1-9, got \" + v);","typeGuard":null,"tryCatchPattern":"try { ClassVersionSwitch.main(args); } catch (RuntimeException e) { if (e.getMessage().contains(\"version not support\")) { printUsageWithValidVersions(); } }","preventionTips":["Remember the tool takes an index 1-9, not a raw Java major version","Consult the jVersions table for the index-to-Java-version mapping","Validate user input before invoking the tool"],"tags":["cli","class-file-version","argument-validation"],"backgroundTag":"argument-out-of-range","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"}