{"record":{"id":"22a4572b57babfd2","repo":"JetBrains/intellij-community","slug":"idea-cannot-generate-javadoc-as-modules-0-do-not","errorCode":null,"errorMessage":"IDEA cannot generate Javadoc as modules {0} do not contain module-info.java file","messagePattern":"IDEA cannot generate Javadoc as modules (.+?) do not contain module-info\\.java file","errorType":"exception","errorClass":"CantRunException","httpStatus":null,"severity":"error","filePath":"java/java-impl/src/com/intellij/javadoc/JavadocGeneratorRunProfile.java","lineNumber":271,"sourceCode":"      Set<Module> modulesWithoutDescriptor = new HashSet<>(modules);\n      Map<Module, VirtualFile> moduleDescriptors = new HashMap<>();\n      boolean hasJavaModules = false;\n      for (VirtualFile source : sources) {\n        if (!PsiJavaModule.MODULE_INFO_FILE.equals(source.getName())) {\n          continue;\n        }\n        hasJavaModules = true;\n        Module module = ModuleUtilCore.findModuleForFile(source, myProject);\n        if (module != null) {\n          moduleDescriptors.put(module, source);\n          modulesWithoutDescriptor.remove(module);\n        }\n      }\n      if (hasJavaModules && !modulesWithoutDescriptor.isEmpty()) {\n        // So far we can't generate javadoc for each module independently as we have to merge the results into common files,\n        // e.g index.html, index-all.html and so on. Moreover, the final javadoc seems obscured in the case when one module contains\n        // module-info file but another one is not.\n        throw new CantRunException(JavaBundle.message(\"javadoc.gen.error.modules.without.module.info\", modulesWithoutDescriptor.stream()\n          .map(m -> \"'\" + m.getName() + \"'\").collect(Collectors.joining(\",\"))));\n      }\n\n      if (JavaSdkVersionUtil.isAtLeast(jdk, JavaSdkVersion.JDK_11)) {\n        for (Module module : modules) {\n          LanguageLevel languageLevel = LanguageLevelUtil.getEffectiveLanguageLevel(module);\n          if (languageLevel.isPreview()) {\n            parameters.add(JavaParameters.JAVA_ENABLE_PREVIEW_PROPERTY);\n            parameters.add(\"--source\", String.valueOf(languageLevel.feature()));\n            break;\n          }\n        }\n      }\n\n      File argsFile = createTempArgsFile();\n      List<VirtualFile> sourceRoots = findSourceRoots(modules);\n      List<VirtualFile> classRoots = findClassRoots(modules, jdk);\n","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/java-impl/src/com/intellij/javadoc/JavadocGeneratorRunProfile.java#L253-L289","documentation":"When at least one collected source is module-info.java (hasJavaModules) but some modules that were scanned lack one, generation aborts: merging javadoc for JPMS and non-JPMS modules into shared output (index.html, index-all.html) is not supported, so IDEA refuses instead of producing broken output. The message lists exactly which module names are missing module-info.java.","triggerScenarios":"Selecting a scope spanning multiple modules where some are JPMS modules (with module-info.java) and others are classic classpath modules, then running Tools | Generate JavaDoc.","commonSituations":"Mixed projects mid-migration to JPMS; utility/legacy modules intentionally left without module descriptors; scopes that accidentally include test or generated modules without module-info.","solutions":["Narrow the javadoc scope to only the modules that have module-info.java, generating per-module sets.","Or add a module-info.java to every module named in the error message so the selection becomes uniform.","Or temporarily deselect the non-modular modules from the scope/package list in the Generate JavaDoc dialog."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure scope is uniform: all selected modules have module-info.java, or none do\nboolean any = modulesInScope.stream().anyMatch(m -> hasModuleInfo(m));\nboolean all = modulesInScope.stream().allMatch(m -> hasModuleInfo(m));\nif (any && !all) { notify(\"Scope mixes JPMS and non-JPMS modules — narrow it or add module-info.java\"); return; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate javadoc per homogeneous module group","Finish JPMS migration (module-info everywhere) before whole-project javadoc"],"tags":["javadoc","jpms","module-info","multi-module","ide"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}