Hi, has anyone ran into trouble with gradle task `...
# gradle
g
Hi, has anyone ran into trouble with gradle task
:kaptGenerateStubsKotlin
with
java.lang.NoClassDefFoundError: Could not initialize class <http://org.jetbrains.kotlin.com|org.jetbrains.kotlin.com>.intellij.pom.java.LanguageLevel
on JVM 17? I’m having a “it works on my machine” problem and the only difference seems to be the JVM version. We were able to amend it by adding gradle.properties settings option
org.gradle.jvmargs=-Dkotlin.daemon.jvm.options=--illegal-access=permit
, but it seems like out of random the build fails even with the option too, in which case we remove the option again-- as if the error switches on and off out of nowhere. Any hints would be appreciated! Thanks in advance!
./gradlew -v
prints following:
Copy code
------------------------------------------------------------
Gradle 7.0
------------------------------------------------------------

Build time:   2021-04-09 22:27:31 UTC
Revision:     d5661e3f0e07a8caff705f1badf79fb5df8022c4

Kotlin:       1.4.31
Groovy:       3.0.7
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          17.0.1 (Oracle Corporation 17.0.1+12-39)
OS:           Mac OS X 11.5.2 x86_64
e
for the record, Gradle below 7.3 doesn't support running on Java 17 https://docs.gradle.org/7.3/release-notes.html#java17
g
Downgrading java version works! Thank you so much 😄
r
Also KAPT + JDK17 needs Kotlin 1.6+ afaik
g
Thanks!! I'll keep that in mind too!
127 Views