Status Update
Comments
ya...@google.com <ya...@google.com>
je...@google.com <je...@google.com>
vm...@google.com <vm...@google.com> #2
Thank you for mentioning, there exist some differences between how IntelliJ is handling JDK and AS, and one of them is to don't showing JAVA_HOME
on Gradle settings
. This will change with the incoming improvement we are doing in this area, meantime I suggest two possible workaround for this:
-
Use the dedicated
Android Studio java home
this internally is using yourJAVA_HOME
and can be selected fromGradle settings
list if available.NOTE: This isn't always added and it's possible you don't have it
-
Probably the best one is to manually modify under project root the
.idea/gradle.xml
file replacing thegradleJvm
line with the bellow, this#JAVA_HOME
is macro supported by IntelliJ and using your defined systemJAVA_HOME
value to setup the gradle daemon during the pre-sync.<option name="gradleJvm" value="#JAVA_HOME" />
I hope this make sense and let us know if you any those workarounds works for you
st...@gmail.com <st...@gmail.com> #3
Using "Android Studio java home" does indeed look like something I have access to. And it points to the right place! I wonder why it may not be visible for some other people though. And yes, doing the #JAVA_HOME workaround seems to work as well. Gonna go with this one myself, thanks for the help.
vm...@google.com <vm...@google.com>
vm...@google.com <vm...@google.com> #4
We exposed the JAVA_HOME
to the Gradle JDK
dropdown under Gradle Settings
, same as IntelliiJ. This changes will be present on AS Flamingo Canary 11
, please feel free to provide any feedback once tested on the mentioned version.
sa...@google.com <sa...@google.com> #5
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Giraffe Canary 1 (2022.3.1.1)
- Android Gradle Plugin 8.1.0
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
Description
On IntelliJ IDEA 2022.2.2 I can simply go to settings and
Build, Execution, Deployment > Build Tools > Gradle
and in that list pick forGradle JVM
the optionJAVA_HOME
which automatically points at the right JDK.In Android studio Flamingo 6, when I go to that exact same path, I do not see the option
JAVA_HOME
butLibrary/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
and other alternatives. It'd be great if we can also make AS point to JAVA_HOME directly, which would mean I don't need to remember to update this when I update my JAVA_HOMEScreenshot showing JAVA_HOME for IntelliJ, and how I don't get that option for AS in the other screenshot.