Title
h

hho

05/27/2021, 6:36 PM
When kapt complains, that it can't find a
tools.jar
(which is correct, because I'm not using Java 8 anymore) – what doesn't work then? Any way to suppress that warning (I'm using Maven)?
a

Aleksei Cherepanov

05/28/2021, 8:23 AM
Hi! Can you please share full warning message?. Also, do you build your project via JPS or via “delegate to Maven”?
h

hho

05/28/2021, 8:31 AM
I'm using Maven on the command line. Full message:
[INFO] --- kotlin-maven-plugin:1.5.0:kapt (kapt) @ simulator ---
[WARNING] 'tools.jar' was not found, kapt may work unreliably
[INFO] Applied plugin: 'spring'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jetbrains.kotlin.kapt3.base.javac.KaptJavaFileManager (file:/home/hho/.m2/repository/org/jetbrains/kotlin/kotlin-annotation-processing-maven/1.5.0/kotlin-annotation-processing-maven-1.5.0.jar) to method com.sun.tools.javac.file.BaseFileManager.handleOption(com.sun.tools.javac.main.Option,java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.jetbrains.kotlin.kapt3.base.javac.KaptJavaFileManager
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
That's with AdoptOpenJDK 11, so there is indeed no
tools.jar
and the reflection warning is probably also expected.
a

Aleksei Cherepanov

05/28/2021, 8:51 AM
Thank you, I’ll take a look:loading:
@hho, hi! Thank you for your report! I’ve created issue on :youtrack: : https://youtrack.jetbrains.com/issue/KT-47110 You can subscribe and you will be notified about updates
m

Michael Böiers

06/04/2021, 10:05 AM
Nice to see that this is considered for fixing. What I find more troubling is that when using AdoptOpenJDK 16, the (deprecated) switch
-Dillegal-access=permit
has to be set in order for kapt to work. This means that kapt will cease to work with JDK 17, 18 or whenever that option will be removed.