Java.lang.NoSuchMethodError: java.lang.Integer.compareTo(I)I


#1

The following code:

``

  val oldPeople = array1.filter {
  it.int(“age”)!! > 30
  }


produces an “Exception in thread “main” java.lang.NoSuchMethodError: java.lang.Integer.compareTo(I)I” on the comparison line.

I am using Java 1.7, so I’m a bit confused by this problem. Full trace:

/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:53994,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/htmlconverter.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/JObjC.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Users/cbeust/kotlin/klaxon/target/classes:/Users/cbeust/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/0.5.429/kotlin-stdlib-0.5.429.jar:/Users/cbeust/.m2/repository/org/jetbrains/kotlin/kotlin-runtime/0.5.429/kotlin-runtime-0.5.429.jar:/Users/cbeust/.m2/repository/org/jetbrains/kotlin/kdoc/0.5.429/kdoc-0.5.429.jar:/Users/cbeust/.m2/repository/org/pegdown/pegdown/1.1.0/pegdown-1.1.0.jar:/Users/cbeust/.m2/repository/org/parboiled/parboiled-core/1.0.2/parboiled-core-1.0.2.jar:/Users/cbeust/.m2/repository/org/parboiled/parboiled-java/1.0.2/parboiled-java-1.0.2.jar:/Users/cbeust/.m2/repository/asm/asm/3.3.1/asm-3.3.1.jar:/Users/cbeust/.m2/repository/asm/asm-util/3.3.1/asm-util-3.3.1.jar:/Users/cbeust/.m2/repository/asm/asm-tree/3.3.1/asm-tree-3.3.1.jar:/Users/cbeust/.m2/repository/asm/asm-analysis/3.3.1/asm-analysis-3.3.1.jar:/Users/cbeust/.m2/repository/org/jetbrains/kotlin/kotlin-compiler/0.5.429/kotlin-compiler-0.5.429.jar:/Applications/IntelliJ IDEA 12.app/lib/idea_rt.jar" com.beust.klaxon.KlaxonPackage Connected to the target VM, address: '127.0.0.1:53994', transport: 'socket' Exception in thread "main" java.lang.NoSuchMethodError: java.lang.Integer.compareTo(I)I      at com.beust.klaxon.KlaxonPackage$docExamples$oldPeople$1.invoke(Main.kt:61)      at com.beust.klaxon.KlaxonPackage$docExamples$oldPeople$1.invoke(Main.kt)      at kotlin.KotlinPackage$src$_Iterables$1268520095.filterTo(_Iterables.kt:47)


#2

Please report bugs to the tracker


#3

http://youtrack.jetbrains.com/issue/KT-3613