[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.

GitOrigin-RevId: 3e27c308520d3522572fdfc2ee57e4d6c4e2ab63
This commit is contained in:
Alexander Koshevoy
2025-10-22 21:59:36 +00:00
committed by intellij-monorepo-bot
parent ecbf3379fd
commit 58a756bf22
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();
});
});
}