compose 发现java8不可需要 java11 才可以 差错如下。

An exception occurred applying plugin request [id: 'com.androidgradle教程.application']
> Failed to apply plugin 'com.android.internal.application'.
> Android Grappleadle plugin requiregradle怎样读s Java 11 to run. You are currently using Java 1.8.
You can try some of the following opJavations:
- changing the IDE settings.
- changing the JAVjava模拟器A_HOME environment variable.
-java语言 cgradle依靠坐标怎样找hanging `org.gradle.java.home` in `gradle.properties`.

呈现的原因可以查看 AGJavaP 7.0: Next major reljava编译器ease for the Android Gradle plugin

老版本的AS 可以在这里更改。

Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

新版本的却不可。没有这个选项了

Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

正确的更改方法如下

Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

查看其时jdk 的目录方位

$ /usr/gradlewlibexec/java_home -v 11
/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/ConteAPPnts/Home
$ echo $JAVA_HOME
/Library/Java/JavgradleaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home