{"record":{"id":"5027676bbb922e6c","repo":"openjdk/jdk","slug":"warning-illegal-character-in-boot-class-path-valu","errorCode":null,"errorMessage":"WARNING: illegal character in Boot-Class-Path value: %s\\n","messagePattern":"WARNING: illegal character in Boot-Class-Path value: (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java.instrument/share/native/libinstrument/InvocationAdapter.c","lineNumber":890,"sourceCode":"         */\n        path = strdup(paths[i]);\n        jplis_assert(path != (char*)NULL);\n\n        /*\n         * The attribute is specified to be a list of relative URIs so in theory\n         * there could be a query component - if so, get rid of it.\n         */\n        pos = strchr(path, '?');\n        if (pos != NULL) {\n            *pos = '\\0';\n        }\n\n        /*\n         * Check for characters that are not allowed in the path component of\n         * a URI.\n         */\n        if (validatePathChars(path)) {\n            fprintf(stderr, \"WARNING: illegal character in Boot-Class-Path value: %s\\n\",\n               path);\n            free(path);\n            continue;\n        }\n\n\n        /*\n         * Next decode any escaped characters. The result is a UTF8 string.\n         */\n        TRANSFORM(path, decodePath(path,&len));\n\n        /*\n         * Convert to the platform encoding\n         */\n        {\n            char platform[MAXPATHLEN];\n            int new_len = convertUtf8ToPlatformString(path, len, platform, MAXPATHLEN);\n            free(path);","sourceCodeStart":872,"sourceCodeEnd":908,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/java.instrument/share/native/libinstrument/InvocationAdapter.c#L872-L908","documentation":"Warning emitted while expanding the Boot-Class-Path manifest attribute of an agent jar: the path component contains characters that are not legal in a URI path (per PathCharsValidator), so the entry is skipped and that path is not added to the bootstrap class loader search. Agent startup continues; only that classpath entry is lost.","triggerScenarios":"A Boot-Class-Path entry containing characters like space, '[' or non-URI-safe bytes that are not percent-encoded; entries with unescaped non-ASCII on some platforms.","commonSituations":"Agent jars built on Windows with 'C:\\Program Files\\...' paths in Boot-Class-Path; manifests containing raw spaces in directory names.","solutions":["Percent-encode illegal characters in Boot-Class-Path entries (e.g. %20 for space) or remove the offending characters","Move the referenced jar/dir to a path without spaces or special characters","Re-check with -verbose:class or -Xlog:class+load which classes came from the boot path to confirm the fix"],"exampleFix":"# before (manifest)\nBoot-Class-Path: /opt/my libs/agent-boot.jar\n# after\nBoot-Class-Path: /opt/my%20libs/agent-boot.jar","handlingStrategy":"validation","validationCode":"// lint Boot-Class-Path entries at build time\nfor (String e : bootClassPath.split(\" \")) {\n    String path = e.split(\"[?]\")[0];\n    if (!path.matches(\"[A-Za-z0-9:/_.%~-]+\"))\n        throw new IllegalArgumentException(\"Boot-Class-Path entry has illegal chars: \" + e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Percent-encode spaces and special characters in manifest paths","Prefer deployment directories without spaces for agents and their boot jars"],"tags":["java-instrument","boot-class-path","manifest","uri-encoding","classpath"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}