{"record":{"id":"6d4ca8bf8352a1d9","repo":"JetBrains/intellij-community","slug":"cannot-generate-javadoc-no-javadoc-tool-found-at","errorCode":null,"errorMessage":"Cannot generate JavaDoc - no javadoc tool found at {0} or {1}. Please specify a valid Java SDK in Settings | Project Structure.","messagePattern":"Cannot generate JavaDoc - no javadoc tool found at (.+?) or (.+?)\\. Please specify a valid Java SDK in Settings \\| Project Structure\\.","errorType":"exception","errorClass":"CantRunException","httpStatus":null,"severity":"error","filePath":"java/java-impl/src/com/intellij/javadoc/JavadocGeneratorRunProfile.java","lineNumber":169,"sourceCode":"    }\n\n    private void setExecutable(Sdk jdk, GeneralCommandLine cmdLine) throws ExecutionException {\n      String binPath = jdk != null && jdk.getSdkType() instanceof JavaSdkType ? ((JavaSdkType)jdk.getSdkType()).getBinPath(jdk) : null;\n      if (binPath == null) {\n        throw new CantRunException(JavaBundle.message(\"javadoc.generate.no.jdk\"));\n      }\n\n      cmdLine.setWorkDirectory((File)null);\n\n      String toolName = SystemInfo.isWindows ? \"javadoc.exe\" : \"javadoc\";\n      File tool = new File(binPath, toolName);\n      if (!tool.exists()) {\n        tool = new File(new File(binPath).getParent(), toolName);\n        if (!tool.exists()) {\n          File javaHomeBinPath = new File(new File(System.getProperty(\"java.home\")).getParent(), \"bin\");\n          tool = new File(javaHomeBinPath, toolName);\n          if (!tool.exists()) {\n            throw new CantRunException(JavaBundle.message(\"javadoc.generate.no.javadoc.tool\", binPath, javaHomeBinPath));\n          }\n        }\n      }\n      cmdLine.setExePath(tool.getPath());\n\n      if (myConfiguration.HEAP_SIZE != null && !myConfiguration.HEAP_SIZE.trim().isEmpty()) {\n        String param = JavaSdkUtil.isJdkAtLeast(jdk, JavaSdkVersion.JDK_1_2) ? \"-J-Xmx\" : \"-J-mx\";\n        cmdLine.getParametersList().prepend(param + myConfiguration.HEAP_SIZE + \"m\");\n      }\n    }\n\n    /* http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#runningjavadoc */\n    private void setParameters(Sdk jdk, GeneralCommandLine cmdLine) throws CantRunException {\n      ParametersList parameters = cmdLine.getParametersList();\n\n      if (myConfiguration.LOCALE != null && !myConfiguration.LOCALE.isEmpty()) {\n        parameters.add(\"-locale\");\n        parameters.add(myConfiguration.LOCALE);","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/java-impl/src/com/intellij/javadoc/JavadocGeneratorRunProfile.java#L151-L187","documentation":"With a JDK configured, the runner locates the javadoc executable: first <jdk>/bin(javadoc|javadoc.exe), then <jdk-parent>/bin, then <java.home>/../bin. If none exists, CantRunException('javadoc.generate.no.javadoc.tool', binPath, javaHomeBinPath) reports both searched paths. This happens when the 'SDK' is actually a JRE (no javadoc binary), a stripped runtime (some compact JDK distributions omit javadoc), or the SDK home points at the wrong directory.","triggerScenarios":"Project SDK is a JRE or a JRE-style runtime (jlink runtime, some Docker base images, older JetBrains Runtime downloads) — directories that contain java but not bin/javadoc — and Tools | Generate JavaDoc is invoked.","commonSituations":"Pointing the SDK at a JRE folder; using a custom runtime image; Linux package managers installing 'default-jre' instead of 'default-jdk'; macOS users selecting /Library/Internet Plug-Ins style JRE paths.","solutions":["Switch the Project SDK to a full JDK (e.g. via apt install default-jdk, or download a Temurin/Oracle JDK) and confirm <jdk>/bin/javadoc exists.","Verify the SDK home directory: it should be the JDK root containing bin/javac, not the embedded jre/ subfolder.","If you must keep a JRE for running, still register a separate full JDK and select it before generating Javadoc."],"exampleFix":"# before: SDK home points at a JRE\n/opt/java/jre-21  (no bin/javadoc)\n\n# after: SDK home points at a full JDK\n/opt/java/jdk-21  (bin/javadoc present)","handlingStrategy":"validation","validationCode":"Sdk sdk = ProjectRootManager.getInstance(project).getProjectSdk();\nString bin = (sdk != null && sdk.getSdkType() instanceof JavaSdkType t) ? t.getBinPath(sdk) : null;\nString tool = SystemInfo.isWindows ? \"javadoc.exe\" : \"javadoc\";\nif (bin == null || !(new File(bin, tool).exists() || new File(new File(bin).getParent(), tool).exists())) {\n  Messages.showWarningDialog(\"Selected SDK has no javadoc tool — use a full JDK\", \"JRE Instead of JDK\");\n  return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point SDK homes at full JDKs (must contain bin/javac and bin/javadoc), never JREs or runtime images","On package-manager installs, prefer default-jdk over default-jre"],"tags":["javadoc","jdk","jre","sdk","environment"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}