Hello all, I'm new to the JVM ecosystem and trying...
# gradle
g
Hello all, I'm new to the JVM ecosystem and trying to use Quarkus + their Kotlin plugin with GraalVM
21.2.0-dev JDK16
Quarkus has Kotlin version set to
"1.4.32"
and haven't yet merged their PR for upgrading to
1.5
I'm not sure what this error means -- but what is happening is that on first-load, my app is fine. Then when I save and the in-process recompilation happens, it throws this error:
Copy code
java.lang.RuntimeException: Unable to invoke Kotlin compiler. java.lang.ExceptionInInitializerError
	at com.intellij.pom.java.LanguageLevel.<clinit>(LanguageLevel.java:25)
	at com.intellij.core.CoreLanguageLevelProjectExtension.<init>(CoreLanguageLevelProjectExtension.java:26)
	at com.intellij.core.JavaCoreProjectEnvironment.<init>(JavaCoreProjectEnvironment.java:42)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment.<init>(KotlinCoreProjectEnvironment.kt:26)
Resulted in: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.util.ResourceBundle.setParent(java.util.ResourceBundle) accessible: module java.base does not "opens java.util" to unnamed module @47d9a273
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
	... 23 more
	at io.quarkus.kotlin.deployment.KotlinCompilationProvider.compile(KotlinCompilationProvider.java:81)
I have googled for some hours, and tried the following (
kotlinOptions.jvmTarget
=
11
)
Copy code
tasks.withType<JavaCompile> {
    options.fork(mapOf(Pair("jvmArgs", listOf("--add-opens", "java.base/java.util=ALL-UNNAMED"))))
}
org.gradle.jvmargs=--illegal-access=permit -Dkotlin.daemon.jvm.options=--illegal-access=permit
Is there any way to make this work 🤔
g
JavaCompile task is not used for Kotlin compilation It looks that better report this to Quarkus Plugin authors, it looks that plugin just not compatible with Java 9+ and modules