{"record":{"id":"1fdc408c815918c8","repo":"oracle/graal","slug":"invalid-jdwp-option-value-key-can-be-only-y-o","errorCode":null,"errorMessage":"Invalid JDWP option value: {key} can be only 'y' or 'n'.","messagePattern":"Invalid JDWP option value: (.+?) can be only 'y' or 'n'\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java","lineNumber":400,"sourceCode":"\n    @Option(help = \"Minimum number of locals to run liveness analysis.\\\\n\" + //\n                    \"Liveness analysis, if enabled, only affects compiled code.\", //\n                    category = OptionCategory.EXPERT, //\n                    stability = OptionStability.EXPERIMENTAL, //\n                    usageSyntax = \"[0, 65535]\") //\n    public static final OptionKey<Integer> LivenessAnalysisMinimumLocals = new OptionKey<>(8);\n\n    @Option(help = \"Enable Class Hierarchy Analysis, which optimizes instanceof checks and virtual method calls by keeping track of descendants of a given class or interface.\", //\n                    category = OptionCategory.EXPERT, //\n                    stability = OptionStability.EXPERIMENTAL, //\n                    usageSyntax = \"false|true\") //\n    public static final OptionKey<Boolean> CHA = new OptionKey<>(true);\n\n    private static final OptionType<com.oracle.truffle.espresso.jdwp.api.JDWPOptions> JDWP_OPTIONS_OPTION_TYPE = new OptionType<>(\"JDWPOptions\", new Function<String, JDWPOptions>() {\n\n        private boolean yesOrNo(String key, String value) {\n            if (!\"y\".equals(value) && !\"n\".equals(value)) {\n                throw new IllegalArgumentException(\"Invalid JDWP option value: \" + key + \" can be only 'y' or 'n'.\");\n            }\n            return \"y\".equals(value);\n        }\n\n        @Override\n        public JDWPOptions apply(String s) {\n            final String[] options = s.split(\",\");\n            String transport = null;\n            String host = null;\n            int port = 0;\n            boolean server = false;\n            boolean suspend = true;\n\n            for (String keyValue : options) {\n                int equalsIndex = keyValue.indexOf('=');\n                if (equalsIndex <= 0) {\n                    throw new IllegalArgumentException(\"JDWP options must be a comma separated list of key=value pairs.\");\n                }","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/EspressoOptions.java#L382-L418","documentation":"Inside the JDWPOptions OptionType converter, yesOrNo() validates that boolean JDWP keys ('server', 'suspend', 'includevirtualthreads') have exactly the single-letter value 'y' or 'n'. Any other value (yes/no, true/false, 1/0) is rejected.","triggerScenarios":"Setting --java.JDWPOptions=...,server=yes or suspend=true, or using 'Y'/'N' uppercase - the check is case-sensitive exact match on 'y'/'n'.","commonSituations":"Copy-pasting agentlib strings from tutorials that use yes/no; translating JDWP options from other tools' formats; uppercase normalization by config management tools.","solutions":["Use single letters exactly: server=y, suspend=n.","Drop the key entirely when the default is acceptable (suspend defaults to y, server to n).","Validate the option string with a regex before launching."],"exampleFix":"# before\n--vm.D...=... --java.JDWPOptions=transport=dt_socket,server=yes,address=:8000\n\n# after\n--java.JDWPOptions=transport=dt_socket,server=y,address=:8000","handlingStrategy":"validation","validationCode":"for (String kv : opts.split(\",\")) {\n    String[] p = kv.split(\"=\", 2);\n    if (Set.of(\"server\",\"suspend\",\"includevirtualthreads\").contains(p[0])\n            && !p[1].equals(\"y\") && !p[1].equals(\"n\")) {\n        throw new ConfigException(kv + \" must be y or n\");\n    }\n}","typeGuard":"static boolean validJdwp(String s) {\n    return s.matches(\"([a-z]+=(y|n|dt_socket|[\\w.\\[\\]:]*\\d+),?)*\");\n}","tryCatchPattern":null,"preventionTips":["Always use single-letter y/n in JDWP strings.","Copy from the option's usageSyntax example, not from generic JDK docs."],"tags":["espresso","graalvm","jdwp","debugging","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}