我在我的旧mac上使用OSX Yosemite。当我安装emulator并尝试创建run a Flatter项目时,我开始收到一个关于JDK 17的错误。我删除了JDK 17并安装了JDK,还将bash概要文件中的路径设置为“Library/Java/JavaVirtualMachines/JDK-1.8.0_321.JDK/Contents/Home”。然而,我的Android studio仍然给出了这个错误。
ERROR: JAVA_HOME is set to an invalid directory: /Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1
我花了几个小时解决这个问题。请帮帮我。非常感谢你。