readLine() causes java.lang.IllegalAccessError


I just downloaded the Kotlin plugin today and I'm doing some coding using existing Java libraries. Everything was going nicely until I decided to add a readLine() call. The code compiled perfectly, when run it emits a java.lang.IllegalAccessError at the readLine() call.

I considered that perhaps some multithreading bug exists in my libraries or the Kotlin standard library, so I made a new project with a single readLine() call in a package-level main function as a quick sanity check. To my surprise I got the same exception.

Considering how commonly I imagine this function is called I’m assuming it’s an issue with my setup rather than the standard library itself, but this is the only problem I’ve run into so far and I’m doing much more complicated stuff elsewhere. Any ideas?

My setup:

  • IDEA CE 11.1.2
  • Kotlin plugin 0.1.2580
  • OpenJDK 1.6.0_22 (Ubuntu package ver. 6b22-1.10.6-0ubuntu1)
  • Ubuntu 11.04 64-bit

The full backtrace: Exception in thread "main" java.lang.IllegalAccessError: tried to access field from class$src$1   at$src$1.readLine(JIO.kt:144)   at   at   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at sun.reflect.NativeMethodAccessorImpl.invoke(   at sun.reflect.DelegatingMethodAccessorImpl.invoke(   at java.lang.reflect.Method.invoke(   at com.intellij.rt.execution.application.AppMain.main(


It's a bug. Please, report to the tracker.


OK, I've done so. Thanks for pointing me in the right direction.