I'm trying to figure out an easy way to run Kotlin scripts either from the command line to play around with Kotlin. I tried two different avenues, first I tried aztec which has azs to run scripts, so I installed it, but when I try to run a script I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jetbrains/asm4/ClassVisitor at com.intellij.core.JavaCoreEnvironment.<init>(JavaCoreEnvironment.java:70) at org.jetbrains.jet.compiler.JetCoreEnvironment.<init>(JetCoreEnvironment.java:47) at org.jetbrains.jet.compiler.CompileEnvironment.<init>(CompileEnvironment.java:88) at org.jetbrains.jet.cli.KotlinCompiler.exec(KotlinCompiler.java:111) at org.jetbrains.jet.cli.KotlinCompiler.exec(KotlinCompiler.java:81) at org.jetbrains.jet.cli.KotlinCompiler.exec(KotlinCompiler.java:73) at org.jetbrains.jet.cli.KotlinCompiler.doMain(KotlinCompiler.java:61) at org.jetbrains.jet.cli.KotlinCompiler.main(KotlinCompiler.java:53) Caused by: java.lang.ClassNotFoundException: org.jetbrains.asm4.ClassVisitor at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 8 more
So then I tried to kotlin-script, which says it needs kotlinc in my path, and I have no idea where to find kotlinc. Again, no luck!
Part of my motivation is that my main project I work on all day doesn’t work with IntelliJ 11.1, so I have to switch between IntelliJ if I want to play around with Kotlin. (I also tried the TextMate bundle, the syntax highlighting is cool, but again running a file doesn’t work).
I’ve also just tried the “kotlin” script in the kotlin project bin directory, but when I try that it says “Idea root not found”. So if anyone has any other good ideas on running kotlin files/scripts outside of IntelliJ please share with me