Kotlin Eclipse environment building
Eclipse
through Marketplace to install Kotlin
plug-in, open Eclipse, select Help-> Eclipse Marketplace… menus, searching for Kotlin
plug-in:
Then restart Eclipse and select Window-> Open Perspective-> Other…, if yousee it Kotlin
option indicates that the installation was successful.
Create a new project
Select File-> New-> Kotlin Project to create Kotlin
project:
After successful creation, the project structure is as follows:
Next, let’s click src
folder, creating a Kotlin
files, no need to write. ".kt"
is automatically added by default, and it can be named at will. Here we create hello
Next, we are in hello.kt
to write some code in the file. Eclipse
provides us with a template to do this quickly, just type main
then press Enter
, that’s it.
Run the application
Next, we are in hello.kt
right-click in the edit box and select Run As-> Kotlin Application to run:
After running successfully, you can run it in the window Console
, you can see the results in.
So the first Kotlin
code is running.