https://kotlinlang.org logo
Title
r

Ruyi Li

12/03/2019, 1:26 PM
> kotlinc -script .\p2.kts
error: invalid argument: -script
info: use -help for more information
Anyone know why this is happening? I'm on Windows and installed Kotlinc through the zip on the releases page, and when I run
kotlinc -version
it outputs
> kotlinc -version
info: kotlinc-native 1.3.60 (JRE 9.0.1+11)
Kotlin/Native: 1.3.60
-script is not listed in the options specified in -help.
m

Mike

12/03/2019, 1:50 PM
Hmm, looks like you're hitting the native compiler, and not the JVM compiler. I see this, and
-script
is an option.
info: kotlinc-jvm 1.3.61 (JRE 1.8.0_222-b10)
Not sure how to control/change which one is used. A path/install issue perhaps?
r

Ruyi Li

12/03/2019, 1:52 PM
Ah, I see, I installed the native package from the repo. Found the normal one though, which does indeed include kotlinc-jvm so hopefully that works now. Thanks!
Also, if you wouldn't mind explaining, what's the difference between the two? kotlin-compiler and kotlin-native-windows, that is.
r

Ruckus

12/03/2019, 2:35 PM
kotlinc-jvm
compiles down to JVM byte code,
kotlinc-native
compiles down to native machine code. (Or I guess to LLVM bit code which LLVM compiles to machine code, I'm not 100% sure on that one. Either way it ends up as native machine code that doesn't need any *VM to run.)
r

Ruyi Li

12/03/2019, 4:56 PM
Oh I see, thank you!