[jps] IDEA-376790 Do not fall back to IDE runtime JDK for non‑local builds

Stop using the local IDE runtime JDK as a fallback when the project builds remotely (Docker/SSH/WSL). This avoids launching the build with a JDK that cannot run on the target machine and prevents hard‑to‑diagnose failures. When no compatible remote JDK is found, we now fail fast. Existing local and WSL‑specific behavior remains unchanged.


(cherry picked from commit 3e27c308520d3522572fdfc2ee57e4d6c4e2ab63)

IJ-CR-179667

GitOrigin-RevId: a3958d861960083811dee737e11a7450009a5863
This commit is contained in:
Alexander Koshevoy
2025-10-24 21:59:36 +00:00
committed by intellij-monorepo-bot
parent 6afeb32486
commit 6e297dc81d
2 changed files with 8 additions and 2 deletions
@@ -1188,7 +1188,12 @@ public final class BuildManager implements Disposable {
.min(Map.Entry.comparingByValue())
.map(p -> Pair.create(p.getKey(), JavaSdkVersion.fromJavaVersion(p.getValue())))
.filter(p -> p.second != null)
.orElseGet(BuildManager::getIDERuntimeSdk);
.orElseGet(() -> {
if (canUseEel() && !EelPathUtils.isProjectLocal(project)) {
throw new IllegalStateException(JavaCompilerBundle.message("build.manager.launch.build.process.failed.to.find.compatible.jdk"));
}
return getIDERuntimeSdk();
});
});
}