Search code examples
command-linepathcompilationkotlin

Kotlin compiling from command line


I need to compile some Kotlin files and run them as described at Kotlin documentation

However, my command line keeps saying this:

C:\Users\name\Documents\Projec\Kotlin>kotlinc 'kotlinc' is not recognized as an internal or external command, operable program or batch file.

I am a 64-bit Windows 7 user. So I downloaded the latest version of the compiler (1.0.6 ATM) and extracted the files into my Program Files folder.

My variable path is set like this:

PATH=C:\Program Files\Java\jdk1.8.0_101\bin; C:\Program Files\kotlinc\bin;C:\Program Files (x86)\Android\android-sdk\platform-tools;

At this point I have no idea, I tried two versions of the compiler and tried changing the path variable few times.

Any help appreciated.


Solution

  • Windows PATH is semicolon-delimited; white space is not trimmed.

    You need to remove the space between ; and C:\Program Files\kotlinc\bin\ in order for the directory to be added correctly to PATH.