5

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?

Tesseract
  • 8,049
  • 2
  • 20
  • 37

1 Answers1

4

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

Marcin Koziński
  • 10,835
  • 3
  • 47
  • 61
Andrey Breslav
  • 24,795
  • 10
  • 66
  • 61