{"record":{"id":"8ad77ebf58dd9be4","repo":"oracle/graal","slug":"unknown-argument-s","errorCode":null,"errorMessage":"Unknown argument: %s","messagePattern":"Unknown argument: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java","lineNumber":496,"sourceCode":"\n    /**\n     * Command line interface for performing the check.\n     */\n    public static void main(String[] args) {\n        Properties sprops = System.getProperties();\n        Map<String, String> props = new LinkedHashMap<>(sprops.size());\n        for (String name : sprops.stringPropertyNames()) {\n            props.put(name, sprops.getProperty(name));\n        }\n        PrintFormat format = PrintFormat.TUPLE;\n        boolean minVersion = false;\n        for (String arg : args) {\n            if (arg.equals(\"--as-tag\")) {\n                format = PrintFormat.AS_TAG;\n            } else if (arg.equals(\"--min-version\")) {\n                minVersion = true;\n            } else {\n                throw new IllegalArgumentException(\"Unknown argument: \" + arg);\n            }\n        }\n        if (minVersion) {\n            String javaSpecVersion = props.get(JAVA_SPECIFICATION_VERSION_PROPERTY);\n            Version v = getMinVersion(props, JVMCI_MIN_VERSIONS);\n            if (v == null) {\n                System.out.printf(\"No minimum JVMCI version specified for JDK version %s.%n\", javaSpecVersion);\n            } else {\n                printVersion(v, format, props);\n            }\n        } else {\n            check(props, true, format);\n        }\n    }\n}\n","sourceCodeStart":478,"sourceCodeEnd":512,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java#L478-L512","documentation":"IllegalArgumentException thrown from the main() of the JVMCIVersionCheck command-line tool when an unrecognized argument is passed. The tool accepts exactly two flags, --as-tag and --min-version; everything else is rejected so typos fail fast instead of silently changing behavior.","triggerScenarios":"Invoking the class as a CLI tool (e.g. mx JVMCIVersionCheck or java ... JVMCIVersionCheck) with any argument other than --as-tag or --min-version, such as --help, --format=tuple, or a misspelled --min-verison.","commonSituations":"Scripts or mx suite configs that call the version-check tool and pass unsupported flags after a GraalVM update that changed the flag set; developers trying --help out of habit.","solutions":["Remove or correct the argument; valid flags are only --as-tag and --min-version.","Run with no arguments to perform the default version check.","Check the tool's source/Javadoc for the supported flag list for your compiler version."],"exampleFix":"# before\nmx JVMCIVersionCheck --format=tuple\n\n# after\nmx JVMCIVersionCheck --as-tag","handlingStrategy":"validation","validationCode":"Set<String> ALLOWED = Set.of(\"--as-tag\", \"min-version\");\nfor (String arg : args) {\n    if (!ALLOWED.contains(arg)) {\n        throw new IllegalArgumentException(\"Unsupported flag, use --as-tag or --min-version: \" + arg);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap CLI invocations of the tool in scripts that whitelist --as-tag and --min-version.","Fail fast on unknown flags in wrappers so typos never reach the tool."],"tags":["graalvm","cli","jvmci","arguments"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}