Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions gradle-261.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ customUntilBuild=261.*
# Existent IDE versions can be found in the following repos:
# https://www.jetbrains.com/intellij-repository/releases/
# https://www.jetbrains.com/intellij-repository/snapshots/
#261.22158.234
ideaVersion=IU-261.22158-EAP-CANDIDATE-SNAPSHOT
clionVersion=CL-261.22158-EAP-CANDIDATE-SNAPSHOT
pycharmVersion=PC-261.22158-EAP-CANDIDATE-SNAPSHOT
riderVersion=RD-2026.1-RC1-SNAPSHOT
#261.22158.*
ideaVersion=IU-2026.1
clionVersion=CL-2026.1
pycharmVersion=PC-2026.1
riderVersion=RD-2026.1
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# supported values: 252, 253, 261
environmentName=261

pluginVersion=2026.9
pluginVersion=2026.10

# type of IDE (IDEA, CLion, etc.) used to build/test running
# for more details see `Different IDEs` section in `PlatformVersions.md`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Errors
error.no.jdk=JDK is not selected. In the settings section, choose or download some JDK
error.no.jdk.need.at.least=JDK is not selected. In the settings section, choose or download some JDK with a version at least {0}
error.no.jdk.available=No JDK found on your system. Please <a href="{0}">configure JDK</a> in IDE settings
error.jdk.loading.failed=Failed to load JDK list. Please check your IDE settings or <a href="{0}">configure JDK manually</a>
error.no.jdk.available=No JDK found on your system. Please configure JDK in IDE settings
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: The <a href="{0}">...</a> links were removed from these messages. Were they previously rendered as clickable hyperlinks anywhere in the UI (e.g. in a notification or validation panel)? If so, users lose a quick shortcut to JDK settings. If they were never actually rendered as hyperlinks, the cleanup makes sense.

error.jdk.loading.failed=Failed to load JDK list. Please check your IDE settings or configure JDK manually
error.no.main=Unable to execute task `{0}`, main method is missing
# Ex.: Gradle project isn't imported. <a href="reload_gradle">Reload Gradle project</a>. For more information, see <a href="">the Troubleshooting guide</a>
error.gradle.not.imported=Gradle project isn''t imported. <a href="{0}">Reload Gradle project</a>. For more information, see <a href="{1}">the Troubleshooting guide</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ private val LOG = logger<JdkLanguageSettings>()

open class JdkLanguageSettings : LanguageSettings<JdkProjectSettings>() {

@Volatile
protected var jdk: Sdk? = null
protected val sdkModel: ProjectSdksModel = createSdkModel()

Expand Down Expand Up @@ -145,52 +146,58 @@ open class JdkLanguageSettings : LanguageSettings<JdkProjectSettings>() {
jdkComboBox.isEnabled = false

runInBackground(course.project, EduJVMBundle.message("progress.setting.suitable.jdk"), false) {
// Reset SDK model off-EDT to avoid IllegalStateException from synchronous progress on EDT
try {
val project = course.project
if (project != null) {
sdksModel.reset(project)
// Reset SDK model off-EDT to avoid IllegalStateException from synchronous progress on EDT
try {
val project = course.project
if (project != null) {
sdksModel.reset(project)
}
}
catch (e: Throwable) {
loadingState = JdkLoadingState.FAILED
// best-effort; if reset fails we'll try with whatever the model currently has
loadingError = e.message
}
}
catch (e: Throwable) {
loadingState = JdkLoadingState.FAILED
// best-effort; if reset fails we'll try with whatever the model currently has
loadingError = e.message
}

// Add bundled JDK if needed (must be done off-EDT as addSdk requires write action)
try {
addBundledJdkIfNeeded(sdksModel)
}
catch (_: Throwable) {
// best-effort; ignore failures
}

// If sdkModel is empty, try to get JDKs directly from ProjectJdkTable
val suitableJdk = findSuitableJdk(minJvmSdkVersion(course), sdksModel)
?: findSuitableJdkFromTable(minJvmSdkVersion(course))
// Add bundled JDK if needed (must be done off-EDT as addSdk requires write action)
try {
addBundledJdkIfNeeded(sdksModel)
}
catch (_: Throwable) {
// best-effort; ignore failures
}

// Check if we found any JDK at all (either suitable or any)
val anyJdkAvailable = sdksModel.sdks.any { it.sdkType == JavaSdk.getInstance() }
|| ProjectJdkTable.getInstance().getSdksOfType(JavaSdk.getInstance()).isNotEmpty()
// If sdkModel is empty, try to get JDKs directly from ProjectJdkTable
jdk = findSuitableJdk(minJvmSdkVersion(course), sdksModel)
?: findSuitableJdkFromTable(minJvmSdkVersion(course))

loadingState = if (anyJdkAvailable) JdkLoadingState.LOADED
else JdkLoadingState.FAILED
// Check if we found any JDK at all (either suitable or any)
if (sdksModel.sdks.all { it.sdkType != JavaSdk.getInstance() }
&& ProjectJdkTable.getInstance().getSdksOfType(JavaSdk.getInstance()).isEmpty()) {
throw RuntimeException(EduJVMBundle.message("error.no.jdk.available"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Throwing RuntimeException for a normal business scenario (no JDKs installed) to unify error handling in the outer catch works, but reads a bit odd. An alternative would be to set FAILED state directly and skip to finally via return@runInBackground. Not a blocker — current approach is functional.

}

loadingError = if (anyJdkAvailable) null
else EduJVMBundle.message("error.no.jdk.available")
loadingState = JdkLoadingState.LOADED
loadingError = null

runInBackground(course.project, EduJVMBundle.message("progress.warming.suitable.jdk"), false) {
// Pre-warm SDK validation and VFS lookups off the EDT to avoid slow operations during UI rendering
prewarmSdkValidation(suitableJdk)
runInBackground(course.project, EduJVMBundle.message("progress.warming.suitable.jdk"), false) {
// Pre-warm SDK validation and VFS lookups off the EDT to avoid slow operations during UI rendering
prewarmSdkValidation(jdk)
}
}
catch (e: Throwable) {
LOG.warn("Failed to preselect JDK", e)
loadingState = JdkLoadingState.FAILED
loadingError = e.message
}
finally {
invokeLater(ModalityState.any()) {
jdkComboBox.isEnabled = true
jdkComboBox.selectedJdk = jdk

invokeLater(ModalityState.any()) {
jdkComboBox.isEnabled = true
jdkComboBox.selectedJdk = suitableJdk
jdk = suitableJdk

notifyListeners()
notifyListeners()
}
}
}
}
Expand Down
Loading