{"record":{"id":"f112b984651ba0e2","repo":"JetBrains/intellij-community","slug":"no-jdk-specified","errorCode":null,"errorMessage":"No JDK specified","messagePattern":"No JDK specified","errorType":"exception","errorClass":"ExecutionException","httpStatus":null,"severity":"error","filePath":"java/execution/impl/src/com/intellij/execution/JavaTestFrameworkRunnableState.java","lineNumber":479,"sourceCode":"          final String actionName = executor.getActionName();\n          throw new CantRunException(JavaCompilerBundle.message(\"action.disabled.when.per.module.working.directory.configured\",\n                                                                actionName));\n        }\n      }\n      else {\n        return;\n      }\n    }\n    else if (isExecutorDisabledInForkedMode()) {\n      final String actionName = executor.getActionName();\n      throw new CantRunException(JavaCompilerBundle.message(\"action.disabled.in.fork.mode\", actionName,\n                                                            StringUtil.toLowerCase(actionName)));\n    }\n\n    final JavaParameters javaParameters = getJavaParameters();\n    final Sdk jdk = javaParameters.getJdk();\n    if (jdk == null) {\n      throw new ExecutionException(ExecutionBundle.message(\"run.configuration.error.no.jdk.specified\"));\n    }\n\n    try {\n      final File tempFile = FileUtil.createTempFile(\"command.line\", \"\", true);\n      try (PrintWriter writer = new PrintWriter(tempFile, StandardCharsets.UTF_8)) {\n        ShortenCommandLine shortenCommandLine = getConfiguration().getShortenCommandLine();\n        boolean useDynamicClasspathForForkMode = shortenCommandLine == null\n                                                 ? JdkUtil.useDynamicClasspath(getConfiguration().getProject())\n                                                 : shortenCommandLine != ShortenCommandLine.NONE;\n        if (shortenCommandLine == ShortenCommandLine.ARGS_FILE) {\n          //see com.intellij.rt.execution.testFrameworks.ForkedByModuleSplitter.startChildFork\n          writer.println(shortenCommandLine);\n        }\n        else if (useDynamicClasspathForForkMode && forkPerModule()) {\n          writer.println(\"use classpath jar\");\n        }\n        else {\n          writer.println(\"\");","sourceCodeStart":461,"sourceCodeEnd":497,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/execution/impl/src/com/intellij/execution/JavaTestFrameworkRunnableState.java#L461-L497","documentation":"In appendForkInfo, after fork-mode checks pass, the state computes JavaParameters and requires javaParameters.getJdk() to be non-null; when the run configuration resolved to no JDK/Sdk, an ExecutionException('No JDK specified') is thrown and the run stops before any process starts.","triggerScenarios":"JavaParameters produced by the test run configuration have a null JDK: project SDK removed/renamed, module SDK invalid, JRE path pointing to a deleted JDK home, or a runner that never set the JDK (e.g. JPS build not yet run, or dependency resolution failed).","commonSituations":"SDK defined by path that no longer exists (moved/updated JDK), project SDK set to 'No SDK' after import, module inherited SDK removed, or CI machines lacking the configured JDK. Also when the JdkSelector cannot map the chosen 'Alternative JRE' path.","solutions":["Open File | Project Structure | Project (and Modules) and set a valid Project/Module SDK","If the run configuration specifies an 'Alternative JRE' / JRE path, fix it to an existing JDK installation","Re-import/refresh the project (Maven/Gradle sync) so SDK references resolve","Verify the JDK path exists on disk (java -version via that home) — on CI, ensure the JDK is installed and the path matches"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify a JDK resolves before building the command line\nSdk jdk = javaParameters.getJdk();\nif (jdk == null || jdk.getHomePath() == null || !new File(jdk.getHomePath()).isDirectory()) {\n  throw new ConfigurationError(\"Configure a valid Project/Module SDK\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  state.appendForkInfo(executor);\n} catch (ExecutionException e) {\n  if (ExecutionBundle.message(\"run.configuration.error.no.jdk.specified\").equals(e.getMessage())) {\n    promptToConfigureSdk();\n  }\n}","preventionTips":["Keep Project SDK pointing at an existing JDK home; update it after JDK upgrades","On CI, verify JAVA_HOME / configured SDK path before launching tests","If using 'Alternative JRE' in a config, validate the path still exists"],"tags":["run-configuration","jdk","sdk","execution","environment"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}