Fix: Toolchain installation does not provide the required capabilities: [JAVA_COMPILER]
Gradle is compiling with a JRE. It is not searching your machine, it is using the exact JVM it was launched on. Point flutter config --jdk-dir at a real JDK, or clear org.gradle.java.home.