Exception in thread "main" java.lang.NoClassDefFoundError: std/io/namespace


#1

Guys,

I’m following “The Koltin Journey” (http://hadihariri.com/2012/02/17/the-kotlin-journey-part-i-getting-things-set-up/), and I have everything setup in Intellij just fine. However, when I try to run as described in the blog, I get:

/home/user/apps/java/bin/java -Didea.launcher.port=7534 -Didea.launcher.bin.path=/home/user/apps/idea-IU-116.32/bin -Dfile.encoding=UTF-8 -classpath /home/user/apps/java/jre/lib/jce.jar:/home/user/apps/java/jre/lib/jsse.jar:/home/user/apps/java/jre/lib/rt.jar:/home/user/apps/java/jre/lib/charsets.jar:/home/user/apps/java/jre/lib/management-agent.jar:/home/user/apps/java/jre/lib/javaws.jar:/home/user/apps/java/jre/lib/deploy.jar:/home/user/apps/java/jre/lib/resources.jar:/home/user/apps/java/jre/lib/plugin.jar:/home/user/apps/java/jre/lib/ext/localedata.jar:/home/user/apps/java/jre/lib/ext/dnsns.jar:/home/user/apps/java/jre/lib/ext/sunpkcs11.jar:/home/user/apps/java/jre/lib/ext/sunec.jar:/home/user/apps/java/jre/lib/ext/sunjce_provider.jar:/home/user/apps/java/jre/lib/ext/zipfs.jar:/home/user/IdeaProjects/KotlinTest/out/production/KotlinTest:/home/user/apps/idea-IU-116.32/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain namespace

Exception in thread “main” java.lang.NoClassDefFoundError: std/io/namespace
  at namespace.main(HelloWorld.kt:15)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:601)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: std.io.namespace
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
  … 6 more

Any ideas regarding what needs to be changed?

Thanks!


#2

Is the Kotlin runtime jar on the classpath somewhere?  It should be located in lib/ in your project directory.  If it's not there, the IDE plugin should offer to install it for you.


#3

Incidentally we renamed the standard library from std.* to be kotlin.* - the api docs are here BTW... http://jetbrains.github.com/kotlin/versions/snapshot/apidocs/index.html


#4

Thanks guys. I updated to a nightly build of the plugin, re-created the project, and was indeed prompted to add Kotlin to it. Everything works fine now.