跳到主要内容

运行项目报错

jdk

/Library/Java/JavaVirtualMachines : jdk-11.0.2.jdk jdk-11.jdk zulu-11.jdk

~/Library/Java/JavaVirtualMachines: corretto-1.8.0_392 corretto-19.0.2 openjdk-21.0.1

Mac端安装JDK、JDK11、OpenJDK11_mac安装jdk11-CSDN博客

//2、将以下代码copy到.zshrc中即可(路径要改为跟自己对应的,且勿与已有配置重复造成冲突)

JDK Config

JAVA_HOME_8=/Users/debugger/Library/Java/JavaVirtualMachines/corretto-1.8.0_392/Contents/Home
JAVA_HOME_11=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home

export JAVA_HOME=$JAVA_HOME_11
alias jdk8="export JAVA_HOME=$JAVA_HOME_8 && echo current JDK has switched to oracle jdk version 1.8. && java -version"
alias jdk11="export JAVA_HOME=$JAVA_HOME_11 && echo current JDK has switched to openjdk version 11. && java -version"

CLASS_PATH="$JAVA_HOME/lib"
PATH="$PATH:$JAVA_HOME/bin"

FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. · Issue #85972 · flutter/flutter · GitHub