Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module jdk.compiler does not export com.sun.tools.javac.util.. Compile time error

Getting this error while building the shadowsocks project.

(https://github.com/shadowsocks/shadowsocks-android)

java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x1d312b6c) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x1d312b6c at org.jetbrains.kotlin.kapt3.base.KaptContext.(KaptContext.kt:28)

like image 596
Mohammad Taqi Velani Avatar asked Dec 06 '25 03:12

Mohammad Taqi Velani


2 Answers

I encountered this problem when running an old app. My original kotlin version was 1.3.72 and i updated it to 1.8.21 and my problem was solved.

like image 185
Safak Avatar answered Dec 07 '25 23:12

Safak


In my situation, the issue was that the Gradle file defined VERSION_17, but the Gradle JDK was chosen as JDK 21; as a result, I was having trouble, so I changed the JDK version to 17. Make sure both versions are same.

enter image description here

enter image description here

like image 23
Rahul Kamble Avatar answered Dec 07 '25 23:12

Rahul Kamble



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!