Kotlin-jdk-annotations.jar does not exist

hello,

I was having a try whether constructor params would accept a default value in conjunction with using delegates:

open trait Base
{
  abstract var count: Int

  fun increment() {
  count++
  }
}

open class BaseImpl : Base {
  override var count = 0
}

class Derived(b : Base = BaseImpl()) : Base by b {

}

fun main(args: Array<String>)
{
  val d = Derived()
  d.increment()
  println(d.count)
}


This also compiled to my delight, but I got this runtime error:

Kotlin: [Internal Error] java.lang.IllegalStateException: Path C:Dokumente und Einstellungenfoo.IdeaIC11configpluginsKotlinkotlinclibkotlin-jdk-annotations.jar does not exist.
  at org.jetbrains.jet.utils.PathUtil.jarFileOrDirectoryToVirtualFile(PathUtil.java:138)
  at org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment.<init>(JetCoreEnvironment.java:97)
  at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModule(KotlinToJVMBytecodeCompiler.java:110)
  at org.jetbrains.jet.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules(KotlinToJVMBytecodeCompiler.java:134)
  at org.jetbrains.jet.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.java:132)
  at org.jetbrains.jet.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.java:54)
  at org.jetbrains.jet.cli.common.CLICompiler.exec(CLICompiler.java:117)
  at org.jetbrains.jet.cli.jvm.K2JVMCompiler.exec(K2JVMCompiler.java:181)
  at org.jetbrains.jet.cli.jvm.K2JVMCompiler.exec(K2JVMCompiler.java:54)
  at org.jetbrains.jet.cli.common.CLICompiler.exec(CLICompiler.java:47)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


I created the Kotlin project as usual: create a Kotlin file, then the IDE asks whether to choose “Set up ‘MyProject’ as JVM Kotlin module” or Javascript. So I select JVM and it creates a lib dir that contains kotlin-runtime.jar but no kotlin-jdk-annotations.jar. Question is whether the IDE missed to insert the kotlin-jdk-annotations.jar or whether I got something wrong.

By the way this solution

class Derived(b : Base = BaseImpl()) : Base by b {

}

fun main(args: Array<String>)
{
  val d = Derived()
  d.increment()
  println(d.count)
}


is absolutely good enough for me that I can live without statefull traits as this here also compiles:

class Derived(b : Base = BaseImpl(), b2 : Base2 = BaseImpl2()) : Base by b, Base2 by b2 {

}


So in the end I’m not that happy with these comments I made in the blog section. Should have spent more time thinking what to write. I won’t be upset if those comments get silently removed.

Regards, Oliver

Oops, I forgot: am using IC-123.23 and Kotlin plugin 0.4.254

I found the reason now: the problem occurs when using JDK1.6.0_25 and doesn't when using JKD1.7.0_09. The version of the Kotlin plugin is not the issue then. Created issue http://youtrack.jetbrains.com/issue/KT-3125