FAILURE: Build failed with an exception.
-
What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:Program FilesAndroidAndroid Studiojrebinjava.exe -
Try:
Run with –stacktrace option to get the stack trace.
Run with –info or –debug option to get more log output.
Run with –scan to get full insights.
- Get more help at https://help.gradle.org
Exception: Gradle task assembleDebug failed with exit code 1
3
Answers
This solution worked for me:
If someone faces this error after Android Studio update to Android Studio Electric Eel | 2022.1.1 than simply follow following steps:
C:Program FilesAndroidAndroid Studio
) and remove jre folder.cd C:Program FilesAndroidAndroid Studio
mklink /D "jre" "jbr"
I have found 3 links where people faced the same or something similar to what you are having. I hope these help! 🙂
IntelliJ Gradle Plugin: The supplied javaHome seems to be invalid
Android Studio – supplied javaHome is not a valid folder
The supplied javaHome seems to be invalid
If someone facing a problem with update from AS Electric Eel 2022.1.1 patch 1 to AS Electric Eel 2022.1.1 patch 2, the following solution worked for me:
1 Create an empty file
/jre/bin/.marker
in AS folder2 Run update again
Note:
since AS Electric Eel 2022.1.1 patch 1 there is no
jre
folder, butjbr
folder exists insteadMy environment:
Windows 11
AS folder is c:/android/android_studio