Tuesday 14 November 2017

Installing Kotlin in command line mode

Download kotlin from below location. At the time of writing this article, 1.1.4 is the latest version.

Unzip the downloaded zip file, and add the bin directory to system path.

Open new command prompt and type ‘kotlinc’ command.

C:\>kotlinc
Welcome to Kotlin version 1.1.4 (JRE 1.8.0_102-b14)
Type :help for help, :quit for quit
>>>

As you see above output, it shows the kotlin version and underlying jre version.

Type the command ‘:help’ to list available commands.

C:\>kotlinc
Welcome to Kotlin version 1.1.4 (JRE 1.8.0_102-b14)
Type :help for help, :quit for quit
>>>

You can evaluate expressions in Kotlin prompt.

>>> var a =10
>>> var b = 20
>>> a + b
30
>>> a-b
-10
>>> a*b
200
>>> a/b
0
>>> println(a)
10
>>> println("value of b : " + b)
value of b : 20




Previous                                                 Next                                                 Home

No comments:

Post a Comment