In this tutorial you will learn how to run Kotlin program in Eclipse IDE.
Below is the step by step procedure to install Kotlin plugin and then configure Eclipse to run Kotlin program. The process is same and should work on all Eclipse versions.
Note: Make sure JDK is already installed on your system.
How to Run Kotlin Program in Eclipse IDE?
1. First open Eclipse IDE and at top menu go to Help > Eclipse Marketplace.
2. Now search for kotlin in the search box. This will show kotlin plugin for eclipse. Click on Install button then Confirm button, finally accept the licence agreement to install the plugin. Just restart eclipse after plugin installation.
3. Go to Window > Perspective > Open Perspective > Other. Now select Kotlin and click Ok button. This will open Kotlin Perspective.
4. Its time to create a demo Kotlin project and run a program. Go to File > New > Kotlin Project and create project with a name you like.
5. In left sidebar you can see Package Explorer. Expand the project you have created and right click on src folder, then select New > Kotlin File. Create kotlin source file with any name.
6. Add some code in the source file. Select the source file from left sidebar and then click on run button to run the program (see below screenshot).
7. The output will be displayed in the Console window.
Comment below if you are facing any difficulty to run kotlin program in eclipse.
ERROR:
The archive: /hello/kotlin_bin which is referenced by the classpath, does not exist.
file’s name is hello.kt
I always get the same error! Couldn’t find a solution as by now.. Let me know, once you fixed it.