run-track icon indicating copy to clipboard operation
run-track copied to clipboard

this error occurs while i run this code in android studio, even i switch java 11 it still shows this , how to solve this ?

Open viveksingh77 opened this issue 9 months ago • 2 comments

java.lang.IllegalAccessError: superclass access check failed: class org.jetbrains.kotlin.kapt3.base.javac.KaptJavaCompiler (in unnamed module @0x15188ce6) cannot access class com.sun.tools.javac.main.JavaCompiler (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.main to unnamed module @0x15188ce6

viveksingh77 avatar Feb 18 '25 06:02 viveksingh77

Make the Gradle Java version (File> Settings > Build, Execution, Deployment > Build Tools > Gradle) to Java 17 or Lower (Java 11 and build it. Let me know if you face any issues.

sDevPrem avatar Feb 19 '25 05:02 sDevPrem

I have the same issue. Using openjdk 17.0.14 gives the same result as before.

java.lang.IllegalAccessError: superclass access check failed: class org.jetbrains.kotlin.kapt3.base.javac.KaptJavaCompiler (in unnamed module @0x205f6259) cannot access class com.sun.tools.javac.main.JavaCompiler (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.main to unnamed module @0x205f6259

When I try Java 11.0.27, I get

Gradle JVM version incompatible.
This project is configured to use an older Gradle JVM that supports up to version 11 but the current AGP requires a Gradle JVM that supports version 17.

120-cell avatar Jun 12 '25 18:06 120-cell