Skip to content

Instantly share code, notes, and snippets.

@lzimd
Created September 16, 2021 09:28
Show Gist options
  • Save lzimd/9e13c755b748dc2fda3091c7aa7eb920 to your computer and use it in GitHub Desktop.
Save lzimd/9e13c755b748dc2fda3091c7aa7eb920 to your computer and use it in GitHub Desktop.
intellij-community JdkList
// https://github.com/JetBrains/intellij-community/blob/idea/212.5284.40/platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/jdkDownloader/JdkList.kt
@Service
class JdkListDownloader : JdkListDownloaderBase() {
companion object {
@JvmStatic
fun getInstance() = service<JdkListDownloader>()
}
override val feedUrl: String
get() {
val registry = runCatching { Registry.get("jdk.downloader.url").asString() }.getOrNull()
if (!registry.isNullOrBlank()) return registry
return "https://download.jetbrains.com/jdk/feed/v1/jdks.json.xz"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment