{"record":{"id":"223b09fe11c29d22","repo":"JetBrains/intellij-community","slug":"was-not-able-to-determine-jdk-for-project","errorCode":null,"errorMessage":"Was not able to determine JDK for project ","messagePattern":"Was not able to determine JDK for project ","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java","lineNumber":476,"sourceCode":"    final Pair<Sdk, JavaSdkVersion> runtime = BuildManager.getJavacRuntimeSdk(myProject);\n\n    final Sdk sdk = runtime.getFirst();\n    final SdkTypeId type = sdk.getSdkType();\n    String javaHome = null;\n    if (type instanceof JavaSdkType) {\n      javaHome = sdk.getHomePath();\n      if (!isJdkOrJre(javaHome)) {\n        // this can be a java-dependent SDK, implementing JavaSdkType\n        // hack, because there is no direct way to obtain the java sdk, this sdk depends on\n        final String binPath = ((JavaSdkType)type).getBinPath(sdk);\n        javaHome = binPath != null? new File(binPath).getParent() : null;\n        if (!isJdkOrJre(javaHome)) {\n          javaHome = null;\n        }\n      }\n    }\n    if (javaHome == null) {\n      throw new IOException(\"Was not able to determine JDK for project \" + myProject.getName());\n    }\n\n    final OutputCollector outputCollector = new OutputCollector();\n    DiagnosticCollector diagnostic = new DiagnosticCollector();\n\n    final Set<File> sourceRoots = FileCollectionFactory.createCanonicalFileSet();\n    if (!sourcePath.isEmpty()) {\n      sourceRoots.addAll(sourcePath);\n    }\n    else {\n      for (File file : files) {\n        final File parentFile = file.getParentFile();\n        if (parentFile != null) {\n          sourceRoots.add(parentFile);\n        }\n      }\n    }\n    final Map<File, Set<File>> outs = Collections.singletonMap(outputDir, sourceRoots);","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java#L458-L494","documentation":"Error \"Was not able to determine JDK for project \" thrown in JetBrains/intellij-community.","triggerScenarios":"Compilation is started while the project has no SDK configured, or the configured JDK was removed or is invalid.","commonSituations":"Freshly checked-out project without an SDK, a project JDK pointing at a deleted JDK installation, or a project opened before any JDK was registered in the IDE.","solutions":["Assign a Project SDK under File | Project Structure | Project Settings | Project.","If no JDK exists, add one under File | Project Structure | Platform Settings | SDKs, then select it as the project SDK."],"exampleFix":"File | Project Structure | Project -> SDK: choose a configured JDK (e.g. temurin-17).","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"}