Using ktlint from brew, version 0.15.0. Works fine on Java 8, switched to Java 9 using jenv and get the following error.
Exception in thread "Thread-0" java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class com.github.shyiko.ktlint.core.KtLint
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at com.github.shyiko.ktlint.Main$parallel$consumer$1.run(Main.kt:614)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.github.shyiko.ktlint.core.KtLint
at com.github.shyiko.ktlint.Main.lint(Main.kt:585)
Command is simply: ktlint
$ ktlint --version
null
and
$ ktlint
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jetbrains.kotlin.com.intellij.util.text.StringFactory (file:/tmp/ktlint/ktlint/target/ktlint) to constructor java.lang.String(char[],boolean)
WARNING: Please consider reporting this to the maintainers of org.jetbrains.kotlin.com.intellij.util.text.StringFactory
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
+ verify together with maven/gradle.
The exception and the version showing have been fixed. What鈥檚 remaining is the illegal reflective access. This is a Kotlin compiler that has already been resolved upstream KT-19051 and will land when Kotlin 1.2.30 is released.
@shyiko do you have any plans for a release that is compatible with java 9?
@ifrins as soon as Kotlin 1.2.30 is out
UPDATE:
0.16.0 released with @ifrins fixes included (thank you once again, Francesc!).
[email protected] hasn't been released yet so "An illegal reflective access operation has occurred" warning is still printed (to stderr) but other than that it appears to be working.
[email protected] with [email protected] is out. Java 9 support is now official. Thanks everyone :bowing_man:
Most helpful comment
@ifrins as soon as Kotlin 1.2.30 is out