Kotlin 1.2.50 causing java.lang.IllegalStateException ScriptingCompilerConfigurationComponentRegistrar is not compatible with this version of compiler

I have the same issue. Tried everything mentioned above but its still there.

  1. Upgraded Intellij kotlin plugin to 1.2.51.
  2. Upgraded sdkman kotlin version to 1.2.51. (or deleted it then it reports kotlin home invalid)
  3. Tried wrapper version 4.7 or 4.8, but neither worked

it failed in both command line and intellij. What else can i try?

Update: I finally got it working after disabling sdkman (comment out its script in my bash profile) to remove the KOTLIN_HOME. After that, it picks up Intellij installed kotlin. So for me it is also a kotlin version conflicts between sdkman and intellij, though all are 1.2.51 they seem to be different version and incompatible.

Curiously the IllegalStateException problem only occurs when using Gradle via the terminal. If Gradle is used via IntelliJ then the problem doesn’t occur. The only constant in this thread is that downgrading Kotlin to 1.2.41 fixes the problem, however it is a temporary workaround which isn’t feasible for all Kotlin projects.

Apparently the same issue: Compiler version incompatibility · Issue #12 · Kotlin/workshop · GitHub

And kotlin issue: https://youtrack.jetbrains.com/issue/KT-24438
marked as fixed but people are still reporting it.

I might be late to the discussion, but still:

That happened to me after using Spring Initializr, as it used Kotlin version 1.2.51 - I updated both the IntelliJ IDE plugin and the version in my gradle file to 1.2.70, and now the error is gone.

I had to restart my computer to make it work.