SuperCell
SuperCell

Reputation: 27

Kotlin compiler error -d invalid argument

I am getting an error when I go to compile the kotlin cmd file for Windows, using their Hello, World! one, but I had to modify part of the compile command to get the -target part to be valid. I am not sure how to fix the invaled -d argument that they show to use.

The text editor is Visual Studio Code.

Compiler: Kotlin-native-windows-1.4.32.zip from JetBrains' GitHub account - https://github.com/JetBrains/kotlin/releases/tag/v1.4.32

My compiler command is kotlinc.bat helloworld.kt -target mingw_x64 -d "hello world/hello world.jar"

Output:

error: invalid argument: -d
info: use -help for more information

How can I fix this?

Upvotes: 1

Views: 1097

Answers (1)

Alexey Belkov
Alexey Belkov

Reputation: 2559

This is the Kotlin/Native compiler, and it supports a different set of command-line arguments.

The solution is to download the Kotlin/JVM compiler from the archive named kotlin-compiler-1.4.32.zip. Since Kotlin 1.5-M1, the Native compiler will show a clarifying warning for this case: Native / CLI: provide a way to show difference between Jvm and Native compilers.

Upvotes: 3

Related Questions