Skip to content

Commit

Permalink
Use available jdk if java home is missing
Browse files Browse the repository at this point in the history
closes #3420
  • Loading branch information
aperfilyev committed Feb 25, 2023
1 parent 815e9cd commit c06629f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ internal class FileIndexMap {
if (!initialized) return@execute emptyMap()

Timber.i("Fetching SQLDelight models")
val javaHome =
ExternalSystemJdkUtil.getJdk(project, ExternalSystemJdkUtil.USE_JAVA_HOME)
?.homeDirectory?.path?.let { File(it) }
val javaHome = (
ExternalSystemJdkUtil.getJavaHome()
?: ExternalSystemJdkUtil.getAvailableJdk(project).second.homePath
)?.let { File(it) }

val properties =
connection.action(FetchProjectModelsBuildAction).setJavaHome(javaHome).run()

Expand Down

0 comments on commit c06629f

Please sign in to comment.