Hi kotlin-Experts,
I learned a bit about Kotlin on try.kotlinlang.org and find it a very interesting programming language. Therefore, I installed the kotlin compiler via sdkman as described here on a Ubuntu box.
Installation went ok, but compilation of the hello world example showed errors (see code and output below)
Has anyone a hint what went wrong … I’m sure more complex source code can be consumed by the kotlin-compiler
Perhaps the compiler has to be combined with specific JVM versions or similar.
Thanks for any help!
Thomas
bkt:~/Develop/Kotlin$ cat hello.kt
fun main(args: Array) {
println(“Hello world.!”);
}
bkt:~/Develop/Kotlin$ kotlinc hello.kt -d hello.jar
Juli 28, 2017 11:23:33 VORM. sun.util.PropertyResourceBundleCharset$PropertiesFileDecoder decodeLoop
INFO: Invalid or unmappable UTF-8 sequence detected. Switching encoding from UTF-8 to ISO-8859-1
exception: java.lang.ArrayIndexOutOfBoundsException: 32768
at org.jetbrains.org.objectweb.asm.ClassReader.readStringish(ClassReader.java:2597)
at org.jetbrains.org.objectweb.asm.ClassReader.readModule(ClassReader.java:2631)
at org.jetbrains.org.objectweb.asm.ClassReader.readModule(ClassReader.java:775)
at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:646)
at org.jetbrains.org.objectweb.asm.ClassReader.accept(ClassReader.java:507)
at org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleInfo$Companion.read(JavaModuleInfo.kt:51)
at org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder.computeAllSystemModules$kotlin_compiler(CliJavaModuleFinder.kt:28)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.computeRootModules(KotlinCoreEnvironment.kt:298)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.addModularRoots(KotlinCoreEnvironment.kt:277)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.convertClasspathRoots(KotlinCoreEnvironment.kt:269)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.(KotlinCoreEnvironment.kt:197)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.(KotlinCoreEnvironment.kt:109)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:423)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:240)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createEnvironmentWithScriptingSupport(K2JVMCompiler.kt:230)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:189)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:55)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:182)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:130)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:52)
at org.jetbrains.kotlin.cli.common.CLICompiler.doMainNoExit(CLICompiler.java:383)
at org.jetbrains.kotlin.cli.common.CLICompiler.doMain(CLICompiler.java:373)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:282)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)
at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
at org.jetbrains.kotlin.preloading.Preloader.run(Preloader.java:70)
at org.jetbrains.kotlin.preloading.Preloader.main(Preloader.java:35)
bkt:~/Develop/Kotlin$ java -version
openjdk version “9-internal”
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)
bkt:~/Develop/Kotlin$