{"record":{"id":"ef2606b32cda7cef","repo":"openjdk/jdk","slug":"warning-s-not-added-to-bootstrap-class-loader-se","errorCode":null,"errorMessage":"WARNING: %s not added to bootstrap class loader search: ","messagePattern":"WARNING: (.+?) not added to bootstrap class loader search: ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java.instrument/share/native/libinstrument/InvocationAdapter.c","lineNumber":964,"sourceCode":"                    fprintf(stderr, \"WARNING: unable to canonicalize %s\\n\", jarfile);\n                    free(path);\n                    continue;\n                }\n                parent = basePath(canonicalPath);\n                jplis_assert(parent != (char*)NULL);\n                haveBasePath = 1;\n            }\n\n            resolved = resolve(parent, path);\n            jvmtierr = (*jvmtienv)->AddToBootstrapClassLoaderSearch(jvmtienv, resolved);\n            free(resolved);\n        }\n\n        /* print warning if boot class path not updated */\n        if (jvmtierr != JVMTI_ERROR_NONE) {\n            check_phase_blob_ret(jvmtierr, free(path));\n\n            fprintf(stderr, \"WARNING: %s not added to bootstrap class loader search: \", path);\n            switch (jvmtierr) {\n                case JVMTI_ERROR_ILLEGAL_ARGUMENT :\n                    fprintf(stderr, \"Illegal argument or not JAR file\\n\");\n                    break;\n                default:\n                    fprintf(stderr, \"Unexpected error: %d\\n\", jvmtierr);\n            }\n        }\n\n        /* finished with the path */\n        free(path);\n    }\n\n\n    /* clean-up */\n    if (haveBasePath && parent != canonicalPath) {\n        free(parent);\n    }","sourceCodeStart":946,"sourceCodeEnd":982,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/java.instrument/share/native/libinstrument/InvocationAdapter.c#L946-L982","documentation":"Warning prefix printed when AddToBootstrapClassLoaderSearch failed for a Boot-Class-Path entry: the named path was not added to the bootstrap class loader search, and the reason follows on the same line (illegal argument / not a JAR, or an unexpected JVMTI error). Startup continues; instrumentation classes from that path will not be found by the bootstrap loader.","triggerScenarios":"Boot-Class-Path entry pointing to a directory or non-JAR file, a nonexistent file, or a path the JVMTI call rejects.","commonSituations":"Agents packaged expecting classes in an extra boot jar that was not shipped; documentation saying to copy a support jar that is missing; pointing Boot-Class-Path at a class directory instead of a jar.","solutions":["Read the suffix on the same stderr line to get the exact cause before acting","Verify each Boot-Class-Path entry is an existing JAR file readable by the JVM","Ship the missing boot jars with the agent or remove stale entries from the manifest","Confirm boot loading works via -Xlog:class+load=info | grep 'boot'"],"exampleFix":"# before\nBoot-Class-Path: /opt/agent/does-not-exist.jar\n# after\nBoot-Class-Path: /opt/agent/agent-boot.jar   # actually shipped with the agent","handlingStrategy":"validation","validationCode":"// verify every Boot-Class-Path entry is an existing jar\nfor (String e : bootEntries) {\n    Path p = Path.of(e);\n    if (!Files.isRegularFile(p) || !p.toString().endsWith(\".jar\"))\n        throw new IllegalStateException(\"bad Boot-Class-Path entry: \" + e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ship and checksum all boot jars referenced by the agent manifest","Watch target JVM stderr at startup for 'not added to bootstrap class loader search' warnings in CI"],"tags":["java-instrument","boot-class-path","jvmti","classpath","configuration"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}