hello guys, is anyone having this Issue? ```java.l...
# kapt
m
hello guys, is anyone having this Issue?
Copy code
java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x50148e28) 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 @0x50148e28
I am having this after update gradle to version 7.2…
youtrack 1
z
m
yeah, I know it, I’ve tried every single solution on the comments of this Issue, and no one has worked …
I have an Android project with Kotlin 1.5.30
z
you're offering fairly vague details. What values do you have for kotlin daemon and gradle daemon properties?
m
I have only this on my
gradle.properties
:
Copy code
android.debug.obsoleteApi=true

#Enable daemon
org.gradle.daemon=true

# Try and findout the best heap size for your project build.
org.gradle.jvmargs=-Xmx3096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# Modularise your project and enable parallel build
org.gradle.parallel=true

# Enable configure on demand.
org.gradle.configureondemand=true
android.useAndroidX=true
android.enableJetifier=true
I don’t have any kotlin deamon parameter setup, but I’ve tried a lot of combinations…
z
that's surprising as that contains none of the solutions proposed in the linked issue
m
I have tried every proposed solution on this Issue, none has worked…
z
make a reproducer project and link it there then
p
https://github.com/probepark/armeria-webflux Here you are reproducible project
Copy code
./gradlew compileTestJava

> Task :kaptGenerateStubsKotlin FAILED
e: java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x3999ecf1) 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 @0x3999ecf1
z
I don’t see where you set jvm arguments as the comments in that linked issue discussion suggest
p
@Zac Sweers I missed out file on the project Please take a look
z
Copy code
--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
is not the correct format, you need to use
=
Copy code
--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
p
Fixed
z
but please be specific when you do so. "Fixed but it doesn't work" is not very helpful on its own
👌 1
2241 Views