Kotlin Development Environment Setup
Setup the development environment locally -
- For this, we need this software - Java(JDK 8) & Intelli J Idea.
- To download JDK, you can follow this link
- Once you have the JDK installed, you need to install IntelliJ Idea which is the IDE recommended by the creators of Kotlin.
- IntelliJ and Kotlin both are created by the same company named JetBrains so you know the reason why they have recommended IntelliJ.
- IntelliJ is fully integrated with Kotlin and helps writing Kotlin code easily. You can find the link here to download Intelli J here
Kotlin Playground -
- You can also run Kotlin code online using Kotlin Playground. This site is provided by Kotlin to play with the small snippets of Kotlin Code. You can run your Kotlin code directly from the browser itself.
Few Questions -
Q: Since we are working with Kotlin. Why we need Java JDK?
Ans: Kotlin is a JVM Language. Kotlin code compiles down to bytecode which will then run on JVM. So we need a JVM. Along with that, we need few Java Libraries which are present in JDK to run the Kotlin program. Java and Kotlin are 100% interoperable. You can call Java code from Kotlin and Kotlin code from Java.
Q: JDK vs JVM?
Asn: JVM is a Java Virtual Machine. Once you compile your Kotlin code, it gets converted to .class files i.e. bytecode. This bytecode runs on JVM. Due to this mechanism of generating bytecode, Kotlin and Java code can run on different environments. We just need a JVM for that particular environment. For instance,
Q: What is .kt?
Ans: .kt is a file extension of Kotlin source code files. Python has .py, Java has .java. etc.
That's it for this article. For more articles on Kotlin Tutorials For Beginner Series - refer to this.
Happy Learning !! Cheers From CheezyCode.