admin管理员组

文章数量:1125883

Currently working on a flutter project and getting this error:

ERROR: JAVA_HOME is set to an invalid directory: /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home

Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

I have tried adding the JDK path on environment variable but I'm still getting the same error even after re-installing android studio. I also can't find this path on my windows 11 machine: /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home

PS:my Java version is as below:

java version "23.0.1" 2024-10-15 Java(TM) SE Runtime Environment (build 23.0.1+11-39) Java HotSpot(TM) 64-Bit Server VM (build 23.0.1+11-39, mixed mode, sharing)

How can this be solved?

本文标签: flutterJAVAHOME is set to Invalid Directory on Android Studio 2024Stack Overflow