kotlin命令行编译器

kotlin命令行编译器

本文介绍了kotlin命令行编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用js命令行编译器?

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

在IDE中,我也无法使js编译正常工作.是否有IntelliJ IDEA 12的最新入门指南?

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?

推荐答案

您需要指定库的路径(kotlin-jslib.jar),使用-libraryFiles命令行选项

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

这篇关于kotlin命令行编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 15:51