{"record":{"id":"eaa00d464a5d4547","repo":"skylot/jadx","slug":"can-t-load-classpath-file","errorCode":null,"errorMessage":"Can't load classpath file: ","messagePattern":"Can't load classpath file: ","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"critical","filePath":"jadx-core/src/main/java/jadx/core/clsp/ClsSet.java","lineNumber":78,"sourceCode":"\t}\n\n\tprivate enum TypeEnum {\n\t\tWILDCARD,\n\t\tGENERIC,\n\t\tGENERIC_TYPE_VARIABLE,\n\t\tOUTER_GENERIC,\n\t\tOBJECT,\n\t\tARRAY,\n\t\tPRIMITIVE\n\t}\n\n\tprivate ClspClass[] classes;\n\n\tpublic void loadFromClstFile() throws IOException, DecodeException {\n\t\tlong startTime = System.currentTimeMillis();\n\t\ttry (InputStream input = ClsSet.class.getResourceAsStream(CLST_PATH)) {\n\t\t\tif (input == null) {\n\t\t\t\tthrow new JadxRuntimeException(\"Can't load classpath file: \" + CLST_PATH);\n\t\t\t}\n\t\t\tload(input);\n\t\t}\n\t\tif (LOG.isDebugEnabled()) {\n\t\t\tlong time = System.currentTimeMillis() - startTime;\n\t\t\tint methodsCount = Stream.of(classes).mapToInt(clspClass -> clspClass.getMethodsMap().size()).sum();\n\t\t\tLOG.debug(\"Clst file loaded in {}ms, android api: {}, classes: {}, methods: {}\",\n\t\t\t\t\ttime, androidApiLevel, classes.length, methodsCount);\n\t\t}\n\t}\n\n\tpublic void loadFrom(RootNode root) {\n\t\tList<ClassNode> list = root.getClasses(true);\n\t\tMap<String, ClspClass> names = new HashMap<>(list.size());\n\t\tint k = 0;\n\t\tfor (ClassNode cls : list) {\n\t\t\tArgType clsType = cls.getClassInfo().getType();\n\t\t\tString clsRawName = clsType.getObject();","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/clsp/ClsSet.java#L60-L96","documentation":"Thrown by ClsSet.loadFromClstFile when the bundled classpath resource (core.jcst at path /clst/core.jcst) is not found on the classpath. The resource is loaded via getResourceAsStream and a null return means the jcst file is missing from the jadx-core JAR or classpath. This is a packaging/classpath integrity error, not an input-file error.","triggerScenarios":"Jadx-core JAR is repackaged or shaded without including the /clst/core.jcst resource. A custom build excluded the resource from the JAR. Running against a corrupted or truncated jadx-core JAR where the resource entry is absent. Using jadx as a library with a minimal classpath that omits the resource directory.","commonSituations":"Custom Maven/Gradle builds that fat-jar jadx without preserving resources. Modifying the jadx build to relocate or filter resources. A broken jadx installation where core.jcst was deleted from the JAR. CI environments with classpath shading plugins that strip non-class resources.","solutions":["Verify that core.jcst exists inside the jadx-core JAR: jar tf jadx-core-*.jar | grep clst/core.jcst.","If missing, rebuild jadx-core from source with the standard Gradle build which bundles the resource, or use the official released JAR.","If shading/relocating, configure the shade plugin to include all resources, not just .class files.","Ensure the jadx-core JAR on the classpath is not corrupted — re-download or rebuild if CRC errors appear."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the core.jcst resource exists on the classpath before calling loadFromClstFile\ntry (InputStream check = ClsSet.class.getResourceAsStream(\"/clst/core.jcst\")) {\n    if (check == null) {\n        throw new IllegalStateException(\"core.jcst not found on classpath — jadx-core JAR may be corrupted or mis-packaged\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    clsSet.loadFromClstFile();\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().startsWith(\"Can't load classpath file:\")) {\n        throw new IllegalStateException(\"jadx-core is missing its bundled core.jcst resource. \"\n            + \"Rebuild or re-download the jadx-core JAR.\", e);\n    }\n    throw e;\n}","preventionTips":["When shading or fat-jarring jadx, configure the build to include all resources, not just .class files.","After building, verify: jar tf jadx-core.jar | grep 'clst/core.jcst' to confirm the resource is present.","Use official released JARs rather than custom repackaged versions when possible."],"tags":["classpath","clst","resource","packaging"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}