3

When I'm using JetBrains Fleet and open the Java project Gradle configuration file build.gradle it shows an error:

Invalid Gradle JDK configuration found. <a href='#open_external_system_settings'>Open Gradle Settings</a>

com.intellij.openapi.externalSystem.service.execution.ExternalSystemJdkException: Invalid Gradle JDK configuration found. <a href='#open_external_system_settings'>Open Gradle Settings</a> 
    
        at org.jetbrains.plugins.gradle.service.execution.LocalGradleExecutionAware.jdkConfigurationException(LocalGradleExecutionAware.kt:184)
        at org.jetbrains.plugins.gradle.service.execution.LocalGradleExecutionAware.prepareJvmForExecution(LocalGradleExecutionAware.kt:122)
        at org.jetbrains.plugins.gradle.service.execution.LocalGradleExecutionAware.prepareExecution(LocalGradleExecutionAware.kt:62)
        at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:90)
        at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:151)
        at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:135)
        at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.executeImpl(ExternalSystemUtil.java:496)
        at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.lambda$execute$0(ExternalSystemUtil.java:327)
        at com.intellij.openapi.project.DumbServiceHeavyActivities.suspendIndexingAndRun(DumbServiceHeavyActivities.java:21)
        at com.intellij.openapi.project.DumbServiceImpl.suspendIndexingAndRun(DumbServiceImpl.java:186)
        at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:327)
        at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:619)
        at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:424)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
        at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:475)
        at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
        at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
        at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:590)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:665)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:621)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:589)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
        at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
        at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
        at java.base/java.lang.Thread.run(Thread.java:833)

How to configure Gradle JDK in JetBrains Fleet?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Dolphin
  • 29,069
  • 61
  • 260
  • 539
  • To me, it looks like there may be an issue with the JDK version that is set in your JAVA_HOME setting/environment variables. You may wish to check there and/or configure the Fleet JDK settings for your project. – COleson Oct 23 '22 at 02:37

1 Answers1

1

By default, Fleet uses the JDK from your JAVA_HOME environment variable. Before proceeding, make sure it is configured in your environment. Otherwise, you can configure a custom JDK for your project as shown in the documentation.

Also, the "java.home" property in .fleet/settings.json user settings file should help.

Please see a documentation for more details.

Andrey
  • 15,144
  • 25
  • 91
  • 187