{"record":{"id":"59eef84d1556f4cd","repo":"quarkusio/quarkus","slug":"failed-to-open-class-path-file-file","errorCode":null,"errorMessage":"Failed to open class path file <file>","messagePattern":"Failed to open class path file <file>","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/dev/QuarkusCompiler.java","lineNumber":175,"sourceCode":"                                File f;\n                                // if it's a \"file\" scheme URI, then use the path as a file system path\n                                // without the need to resolve it\n                                if (cpEntryURI.isAbsolute() && cpEntryURI.getScheme().equals(\"file\")) {\n                                    f = new File(cpEntryURI.getPath());\n                                } else {\n                                    try {\n                                        f = Paths.get(new URI(\"file\", null, \"/\", null).resolve(cpEntryURI)).toFile();\n                                    } catch (URISyntaxException e) {\n                                        f = new File(file.getParentFile(), classPathEntry);\n                                    }\n                                }\n                                if (f.exists()) {\n                                    toParse.add(f.toPath());\n                                }\n                            }\n                        }\n                    } catch (Exception e) {\n                        throw new RuntimeException(\"Failed to open class path file \" + file, e);\n                    }\n                }\n            }\n        }\n    }\n\n    public void setupSourceCompilationContext(DevModeContext context,\n            Set<File> classPathElements,\n            Set<File> reloadableClassPathElements,\n            DevModeContext.ModuleInfo i,\n            DevModeContext.CompilationUnit compilationUnit, String name) {\n        if (!compilationUnit.getSourcePaths().isEmpty()) {\n            if (compilationUnit.getClassesPath() == null) {\n                log.warn(\"No \" + name + \" directory found for module '\" + i.getName()\n                        + \"'. It is advised that this module be compiled before launching dev mode\");\n                return;\n            }\n","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/dev/QuarkusCompiler.java#L157-L193","documentation":"QuarkusCompiler.parseClassPath() walks the classpath entries and, while processing a classpath file, wraps any failure in a RuntimeException with 'Failed to open class path file <file>'. This indicates an entry in the dev mode classpath could not be read or opened (unreadable, deleted mid-scan, or a malformed path).","triggerScenarios":"A JAR or classpath file referenced by the DevModeContext is missing, unreadable (permissions), or a directory/URL entry that throws while being iterated during compiler setup.","commonSituations":"Deleted or moved local Maven repository artifacts while dev mode runs; stale build outputs after branch switches; permission-restricted mounts (e.g. container volume or network drive).","solutions":["Check the 'Caused by' exception to see why the file couldn't be opened (missing vs permission denied).","Restore the missing artifact: run mvn install / gradle build for the missing dependency or module.","Verify file permissions on the classpath file, especially on mounted volumes.","Clean and restart dev mode so a fresh DevModeContext with valid paths is generated."],"exampleFix":"// before: stale entry pointing to a deleted artifact\n~/.m2/repository/com/example/lib/1.0/lib-1.0.jar  (missing)\n\n// after\n./mvnw install -pl lib  # rebuild/reinstall the artifact, then restart dev mode","handlingStrategy":"validation","validationCode":"Path p = Path.of(classpathEntry);\nif (!Files.isReadable(p)) throw new IllegalStateException(\"Unreadable classpath file: \" + p);","typeGuard":null,"tryCatchPattern":"try {\n    // start dev mode\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Failed to open class path file\")) {\n        // rebuild the missing artifact or fix permissions, then restart\n    }\n}","preventionTips":["Don't delete or move ~/.m2 artifacts while dev mode is running.","Clean and restart dev mode after switching git branches that change dependencies.","Ensure project directories live on locally mounted, permission-correct filesystems."],"tags":["quarkus","classpath","compiler","dev-mode"],"backgroundTag":"classpath-file-not-found","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}