kotlin command line compiler

2019-06-26 09:49发布

问题:

How do I use the js command line compiler?

fun main(args: Array<String>): Unit { 
    println("Hello world!") 
}

E:\kotlinc\bin>kotlinc-js -output test -sourceFiles test.kt
ERROR: E:\kotlinc\bin\test.kt: (4, 5) Unresolved reference: println
exec() finished with COMPILATION_ERROR return code

In the IDE I couldn't get js compilation to work either. Is there an up to date getting started guide for IntelliJ IDEA 12?

回答1:

You need to specify a path to the library (kotlin-jslib.jar), use -libraryFiles command line option



标签: kotlin