In this article, we are going to create our Kotlin development environment in Mac.
Below are the articles for installation steps in Windows and Linux
Step 1: Install Java
Kotlin is a JVM language and the compiler will emit Java bytecode. Because of this, we are going to install Java JDK. Visit below URL and download Java JDK.
Below images show the JDK Installation Steps in Mac
For ensuring our Java is Installed Correctly we are going to check the Java Version for this open Command prompt and execute command “java --version”
Below is the output
Step 2: Install Kotlin Compiler
Now JDK is installed we first going to download and Install Kotlin Compiler
Kotlin Compiler Downloaded file is available in Downloads. Extract the Zip file
01 Download and Extract Kotlin Compiler Zip File
Now we ready to use Kotlin Compiler.
Use Command Line Compiler to compile Kotlin Code
First, we are going to write a Hello vLemonn code. Then we are going to compile it using Kotlin Command Line Compiler. And in the last, we are going to run our compile code.
Before moving ahead we are assuming few things.
With the above assumption execute the following command. If some of the points are not valid from the above assumption, please modify commands.
For writing code, we are going to use terminal.
fun main(args: Array<String>) { println("Hello, vLemonn!") }
Below is the output
Step 3: Install IDE for Kotlin
Now we know about how to use Kotlin Compiler. It’s time to check IDE for Kotlin. Kotlin is developed by JetBrains so it is Supported by IntelliJ IDEA. We are going to use IntelliJ IDEA Community edition in our entire tutorial series. IntelliJ IDEA community edition is free to use. But if you want to use Eclipse IDE, then we are going to learn how to enable Kotlin plugin for Eclipse.
Visit below URL to download IntelliJ IDEA for Windows
IntelliJ IDEA Setup is very easy. Double click on the downloaded setup file. Follow the instructions. Below images shows various installation windows.
Step 4: Install Kotlin Eclipse Plugin [optional]
This step is not mandatory. If you love to write code in eclipse follow steps to add Kotlin Plugin.
Finally, install Kotlin Plugin
Please login to post your valuable comments.