Supplied javaHome is not valid folder in Android Project
Struggling for some hours now with this one..
Some issues with SSL Certificates during download of dependencies from our artifactory raised my suspicion that the gradle-integraion in the IDE was using some old JVM on my machine to do the download.
To find out, i created a small task to let gradle print the currently used JVM. This led to an old jdk1.8.0_51, which was in deed still installed on my box. Great I thought, this can be easily fixed! So I ...
- made sure, the JDK of the project was explicitly set to a more recent version. Project Settings -> Project -> Project SDK
- made sure that the Build Tools -> Gradle -> Runner was configured to the exact same more recent version
Clear Cache -> Restart....
No result. Still the old 1.8.051 is used by gradle, run via doubleclick.
In order to verify that I am on the right track concerning my original problem, I deleted the ancient 1.8.051 from my box. This resulted in also the "Build Project" Action of the Android Project to prompt the following message:
"Supplied javaHome is not a valid folder. You supplied: /Library [...]"
To this point this was coherent with my findings from my test-task meaning it really tried to use the now deleted JRE.
The next step was to add an entry to the gradle.properties file:
org.gradle.java.home=/Library/Java/JavaVirtualMachines/[...]
This seemed to prompt some reaction, but did not solve my problem. As nothing happened, I tried to provide a corrupt path, which then prompted the reaction
"Value [SOME BROKEN PATH] given for org.gradle.java.home Gradle property is invalid [...]"
But when I correct the path again, happy Gradle Integration starts looking for the old, already deleted 1.8.051 again.
Can someone maybe help me out with the right strategy to specify the JVM to use, when gradle is run from within IDEA?
IntelliJ IDEA 2018.3.5 (Ultimate Edition)
Build #IU-183.5912.21, built on February 26, 2019
JRE: 1.8.0_152-release-1343-b28 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.3
Please sign in to leave a comment.
Check your Android Platforms defined in the Project Structure | SDKs. Were they updated to use the new JDK?
Thank you Serge, that solved my issue!