@Quickstart Kotlin

By pjain      Published Dec. 15, 2019, 7:06 a.m. in blog Programming   

Kotlin Quickstart, Setup

http://kotlinlang.org/

Setup on cmdLn on Windows

https://github.com/JetBrains/kotlin/releases/tag/v1.2.30

  • It needs Java8 to compile - though will run on Java6+ JVMs
  • downloaded JDK 1.8.0_161 and samples and installed in c:\Java and set cmd vars

The Kotlin compiler now requires JDK 8 to run. You shouldn’t notice any changes, because most other Java development tools such as Gradle and the Android toolchain also require JDK 8, so you almost certainly already have it installed. For code generated by the compiler, Java 1.6 compatibility is still the default, and we have no plans to drop support for generating Java 1.6 compatible bytecode.

  • System env vars - added C:\Development\kotlinc\bin;C:\Development\jdk1.8.0_161\bin C:\Python33\;C:\Development\kotlinc\bin;C:\Development\jdk1.8.0_161\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Broadcom\WHL\;C:\Program Files\Broadcom\WHL\syswow64;C:\Program Files\Broadcom\WHL\SysWow64\;C:\Program Files\Broadcom\WHL\SysWow64\syswow64;C:\Program Files (x86)\Common Files\Ulead Systems\MPEG;C:\Program Files\Common Files\Lenovo;C:\Program Files (x86)\Windows Live\Shared;C:\SWTOOLS\ReadyApps;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\Symantec\VIP Access Client\;C:\Program Files (x86)\Common Files\Lenovo;C:\Program Files (x86)\nodejs\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Development\jdk1.8.0_161;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Python33\Tools\Scripts;C:\Program Files (x86)\PrimeSense\NITE\bin;C:\Program Files\OpenNI\Bin64;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Development\cmake\bin;C:\Development\Git\cmd;C:\Development\Git\mingw64\bin;C:\Development\Git\usr\bin;

  • User vars - path - removed C:\Program Files (x86)\Java\jdk1.7.0_05\bin; C:\Rails\Git\cmd;C:\Rails\Ruby1.9.3\bin;C:\Users\thinkpad1admin\AppData\Roaming\npm\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\node

    c:\pjaindev>cd devw\MobAndrw\kotlin\core c:\pjaindev\devw\MobAndrw\kotlin\core>kotlinc hello.kt -include-runtime -d hello.jar c:\pjaindev\devw\MobAndrw\kotlin\core>java -jar hello.jar Hello, World!

Setup on cmdLn, and IDEAj on Mac/Linux

  • Setup on cmdLn # md/cd ~/DevM/MobAndrM/Kotlin/0LrnCoreKotlin$ # installs sdkman $ curl -s https://get.sdkman.io | bash $ source "/Users/pjain/.sdkman/bin/sdkman-init.sh" $ sdk install kotlin # Downloading: kotlin 1.1.3-2 #x brew install kotlin@1.1-M04

Edit ~/.bashrc adding/modifying following lines

  • in ~/.bashrc and make sure you source ~/.bashrc export KOTLINC=/usr/local/kotlinc export PATH=$PATH:$KOTLINC/bin

  • Setup on IDEAj

Try Online

https://try.kotlinlang.org/#/Examples/Hello,%20world!/Simplest%20version/Simplest%20version.kt


0 comments

There are no comments yet

Add new comment

Similar posts

Serverless Computing

Android Layouts Design 101

Drawing, Canvas in Kotlin

Custom Views