0

I installed flutter 3.7.6 which supposedly fixes the error it was causing in Electric Eel related to the JAVA_HOME env variable. I am now getting the following error:

The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Java\jdk-17\bin\java.exe

I'm told that I no longer need to have a custom installation of Java 17 to fix the Electric Eel problem, so Android Studio shouldn't care about this directory anymore. How do I fix this?

whatwhatwhat
  • 1,991
  • 4
  • 31
  • 50
  • Your java home is still pointing to the directory you installed java 17 in. It needs to point to the java installed with Android Studio. – GrahamD Mar 05 '23 at 10:38
  • @GrahamD how do I switch it? I tried looking in Project Structure but it doesn't let me set my own value for the Java SDK field. It only lets me pick from a dropdown and the options are jbr-11 and Android Studio default JDK. – whatwhatwhat Mar 05 '23 at 21:09
  • Java home is a windows environment variable so you need to edit it yourself. This article may help but basically you need to find the path of the jdk that AS has installed and edit Java home env variable to point at it. https://www-geeksforgeeks-org.cdn.ampproject.org/v/s/www.geeksforgeeks.org/how-to-set-java-sdk-path-in-android-studio/amp/?amp_gsa=1&amp_js_v=a9&usqp=mq331AQKKAFQArABIIACAw%3D%3D#amp_tf=From%20%251%24s&aoh=16780877183564&referrer=https%3A%2F%2Fwww.google.com&ampshare=https%3A%2F%2Fwww.geeksforgeeks.org%2Fhow-to-set-java-sdk-path-in-android-studio%2F – GrahamD Mar 06 '23 at 07:31

1 Answers1

0

Go To android studio directory (Default C:\Program Files\Android\Android Studio) remove jre folder run cmd as administrator

that's work for me check answers here

Sukaina Ahmed
  • 112
  • 1
  • 10
  • The whole jre/jbr folder thing was a hack to deal with the Electric Eel bug. Flutter 3.7.6 is supposed to fix the issue without having to do this – whatwhatwhat Mar 05 '23 at 21:10