# How do I know which kotlin used?

**URL:** <https://discuss.kotlinlang.org/t/how-do-i-know-which-kotlin-used/25178>\
**Category:** Uncategorized\
**Created:** [July 9, 2022, 12:28pm UTC](https://discuss.kotlinlang.org/t/how-do-i-know-which-kotlin-used/25178 "2022-07-09T12:28:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LaurentBerger](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@LaurentBerger](https://discuss.kotlinlang.org/u/LaurentBerger)\
**Post date:** [July 9, 2022, 12:28pm UTC](https://discuss.kotlinlang.org/t/how-do-i-know-which-kotlin-used/25178/1 "2022-07-09T12:28:17Z")

</div>

Hi,  
I’m disrupted with kotlin version installed.

first version with a bug ki-shell 0.5.2 and :

```auto
C:\Users\Laurent>kotlinc -version
info: kotlinc-jvm 1.5.30-release-408 (JRE 18.0.1.1+2-6)

C:\Users\Laurent>java --version
java 18.0.1.1 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

C:\Users\Laurent>C:\Users\Laurent\Desktop\ki\bin\ki.bat -version
java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

C:\Users\Laurent>C:\Users\Laurent\Desktop\ki\bin\ki.bat
ki-shell 0.5.2/1.7.0
type :h for help
[0] var x: String?=null
[1] x = readln()
[2] x?.length
res2: Int = 7
[3] x
res3: String = 123456
[4]

```

Second version installed (android canary)

```auto
F:\android-studio-canary\android-studio\plugins\Kotlin\kotlinc\bin>kotlinc -version
info: kotlinc-jvm 1.7.0-release-for-android-studio (JRE 18.0.1.1+2-6)

F:\android-studio-canary\android-studio\plugins\Kotlin\kotlinc\bin>java -version
java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

F:\android-studio-canary\android-studio\plugins\Kotlin\kotlinc\bin>kotlinc
Welcome to Kotlin version 1.7.0-release-for-android-studio (JRE 18.0.1.1+2-6)
Type :help for help, :quit for quit
>>> var x: String?=null
>>> x = readln()
x = readln()123456
>>> x?.length
res2: kotlin.Int? = 6
>>>

```

With python when I run a script in python console or when I run script from system console results are always equals  
Here 1.7.0 in ki-shell is not Kotlin version 1.7.0 in kotlinc. It’s very disturbing

How do you manage this to ensure that ki-shell and kotlinc are identical?

---

<div class="post-metadata">

**Author:** ![broot](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@broot](https://discuss.kotlinlang.org/u/broot)\
**Post date:** [July 9, 2022, 1:11pm UTC](https://discuss.kotlinlang.org/t/how-do-i-know-which-kotlin-used/25178/2 "2022-07-09T13:11:20Z")

</div>

I’m not entirely sure what do you ask. You can have multiple versions of the Kotlin compiler, it really depends on your local setup.

---

<div class="post-metadata">

**Author:** ![LaurentBerger](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@LaurentBerger](https://discuss.kotlinlang.org/u/LaurentBerger)\
**Post date:** [July 9, 2022, 1:24pm UTC](https://discuss.kotlinlang.org/t/how-do-i-know-which-kotlin-used/25178/3 "2022-07-09T13:24:24Z")

</div>

in ki-shell it’s version 1.7.0 and in kotlinc it’s version 1.7.0 but results are different

Another question in kotlinc I can use it as ki-shell why two versions?

---

<div class="post-metadata">

**Author:** ![broot](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@broot](https://discuss.kotlinlang.org/u/broot)\
**Post date:** [July 9, 2022, 1:38pm UTC](https://discuss.kotlinlang.org/t/how-do-i-know-which-kotlin-used/25178/4 "2022-07-09T13:38:18Z")

</div>

`KI` and `kotlinc` are just two different implementations of REPL for Kotlin. I don’t know what is the reason for a 6 vs 7 difference. It looks like KI intercepted some whitespace char like space or a new line at the end of the string. This is probably not related to your code or Kotlin per se, but rather to how REPL handles the terminal input.

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [July 9, 2022, 2:04pm UTC](https://discuss.kotlinlang.org/t/how-do-i-know-which-kotlin-used/25178/5 "2022-07-09T14:04:08Z")

</div>

You can check stdlib version with `KotlinVersion.CURRENT`. But otherwise @broot is correct.

---

<div class="post-metadata">

**Author:** ![LaurentBerger](https://avatars.discourse-cdn.com/v4/letter/l/97f17d/32.png) [@LaurentBerger](https://discuss.kotlinlang.org/u/LaurentBerger)\
**Post date:** [July 9, 2022, 2:18pm UTC](https://discuss.kotlinlang.org/t/how-do-i-know-which-kotlin-used/25178/6 "2022-07-09T14:18:41Z")

</div>

I check in ki-sh

[

```auto
0] KotlinVersion.CURRENT
res0: KotlinVersion = 1.7.0

```

and in kotlinc

```auto
>>> KotlinVersion.CURRENT
res2: kotlin.KotlinVersion = 1.7.0

```
