0

I updated android studio the day before yesterday and since then I have this error when I try to run my Dart code in my emulator:

The supplied javaHome seems to be invalid. 
I cannot find the java executable. 
Tried location: C:\\Program Files\\Android\\Android Studio\\jre\\bin\\java.exe

However my javascript is well installed, as shown in the following image I can see the Java path in the java configuration panel.

C:\Program Files\Java\jre1.8.0_351\bin\javaw.exe

enter image description here

Also I have this result in command prompt.

C:\>java -version
java version "1.8.0_351"
Java(TM) SE Runtime Environment (build 1.8.0_351-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.351-b10, mixed mode)

How to solve this problem?

Thanks very much !

Simo
  • 21
  • 8

1 Answers1

0

Finally, I found the solution. I didn't have the JAVA_HOME environment variable. I added this variable with the correct path.

C:\Program Files\Java\jre1.8.0_351

Then I went to the path variable and added the following path: %JAVA_HOME%\bin.

In the following folder: C:\Program Files\Android\Android Studio

I had an empty jre folder, I deleted it and android studio recreated a working jre folder.

Simo
  • 21
  • 8