{"record":{"id":"3f957f637599d081","repo":"JetBrains/intellij-community","slug":"compilation-failed","errorCode":null,"errorMessage":"Compilation failed","messagePattern":"Compilation failed","errorType":"exception","errorClass":"CompilationException","httpStatus":null,"severity":"error","filePath":"java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java","lineNumber":513,"sourceCode":"\n    final ExternalJavacManager javacManager = getJavacManager();\n    final CompilationPaths paths = CompilationPaths.create(platformCp, classpath, upgradeModulePath, ModulePath.create(modulePath), sourcePath);\n    // do not keep process alive in tests since every test expects all spawned processes to terminate in teardown\n    boolean compiledOk = javacManager != null && javacManager.forkJavac(\n      javaHome, -1, Collections.emptyList(), options, paths, files, outs, diagnostic, outputCollector,\n      new JavacCompilerTool(), CanceledStatus.NULL, !ApplicationManager.getApplication().isUnitTestMode()\n    ).get();\n\n    if (!compiledOk) {\n      final List<CompilationException.Message> messages = new SmartList<>();\n      for (Diagnostic<? extends JavaFileObject> d : diagnostic.getDiagnostics()) {\n        final JavaFileObject source = d.getSource();\n        final URI uri = source != null ? source.toUri() : null;\n        messages.add(new CompilationException.Message(\n          kindToCategory(d.getKind()), d.getMessage(Locale.US), uri != null? uri.toURL().toString() : null, (int)d.getLineNumber(), (int)d.getColumnNumber()\n        ));\n      }\n      throw new CompilationException(\"Compilation failed\", messages);\n    }\n\n    final List<ClassObject> result = new ArrayList<>();\n    for (OutputFileObject fileObject : outputCollector.getCompiledClasses()) {\n      final BinaryContent content = fileObject.getContent();\n      result.add(new CompiledClass(fileObject.getName(), fileObject.getClassName(), content != null ? content.toByteArray() : null));\n    }\n    return result;\n  }\n\n  private static boolean isJdkOrJre(@Nullable String path) {\n    return path != null && (JdkUtil.checkForJre(path) || JdkUtil.checkForJdk(path));\n  }\n\n  private static CompilerMessageCategory kindToCategory(Diagnostic.Kind kind) {\n    return switch (kind) {\n      case ERROR -> CompilerMessageCategory.ERROR;\n      case MANDATORY_WARNING, WARNING -> CompilerMessageCategory.WARNING;","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java#L495-L531","documentation":"Error \"Compilation failed\" thrown in JetBrains/intellij-community.","triggerScenarios":"javac or another compiler task reports errors during a project build.","commonSituations":"Source errors such as missing symbols, wrong types, missing dependencies, or an invalid annotation processor on the module path.","solutions":["Open the Build tool window or Messages view and fix the reported compile errors.","Rebuild the project (Build | Rebuild Project) after fixing the errors."],"exampleFix":"Fix the error listed in Messages Build, e.g. add the missing import or dependency, then Build | Build Project.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}