Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify Kotlin version?

Tags:

kotlin

I want to compile my Kotlin program using Kotlin 1.0.4. What are the correct command line options for this purpose? I heard about -version option, but don't understand how to use it. -version 1.0.4 doesn't work.

like image 744
Aleksandr Tukallo Avatar asked Jul 13 '26 01:07

Aleksandr Tukallo


1 Answers

The command line argument for this purpose is -language-version and its value should be a major.minor Kotlin release version, of which there are only two at the moment: 1.0 and 1.1.

kotlinc -language-version 1.0 source.kt

To make analysis in IntelliJ IDEA be aware of the version the source will be compiled against, you can create a facet (Project Settings -> Facets -> "+") and select the language version in the dropdown there.

like image 71
Alexander Udalov Avatar answered Jul 14 '26 17:07

Alexander Udalov