Android Studio is using this JDK location … which is different to what Gradle uses by default

前端 未结 5 2344
悲哀的现实
悲哀的现实 2021-02-18 14:07

After Android Studio sync my gradle project, I see the following message in the event log:

Android Studio is using this JDK location:

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-18 14:34

    I started getting this warning after updating to Android studio version 3.6. I was getting below warning:

        Android Studio and Gradle are using different locations for the JDK.
        Android Studio: C:\Program Files\Android\Android Studio\jre
        Gradle: C:\Program Files\AdoptOpenJDK\jdk-11.0.3.7-hotspot
        Using different JDK locations might cause Gradle to spawn multiple daemons
        when executing tasks for Android Studio and other external processes.
    

    To fix this warning I changed the project JDK location to Gradle JDK location.

    1. Right click on app in project window
    2. open module settings
    3. SDK location
    4. JDK location
    5. from dropdown select JDK location of your Gradle. In my case it is below location :

      Gradle: C:\Program Files\AdoptOpenJDK\jdk-11.0.3.7-hotspot
      

    Click apply and Ok.

提交回复
热议问题