错误信息:
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
Your current JDK is located in /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
但是,我已经设置为11了,图中2种方式的11都试过了,再编译还是报错
你走的应该是命令行,那么全局变量的Java是1.8的,你工具内置是11的,然后你那个plugin又要求11。你要么把环境变量也安装成11,如果1.8在其他方面还有使用,那你就别用命令行编译,用工具,也就是Android studio