Eclipse installs the Kotlin plugin from the Marketplace, opens Eclipse, selects the Help -> Eclipse Marketplace... menu, and searches for the Kotlin plugin:
Then restart Eclipse and select Window -> Open Perspective -> Other.... If you see the Kotlin option, the installation is successful.
![Kotlin Eclipse environment setup Kotlin Eclipse environment setup](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQjN0biSbSF3WG_vv1vibPfC8sfKK6TIxJ2hS0TiSygKoDc6S_P02CU8EfhN4zCygLsPci22tqcaDwLvCVXf6WqkbcUoQG7MuBGWnHlN-dGNO3W8PY0QpQkoUwcgVjfiS0NBMI3osrRvY/s320/kotlin+eclipse.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBpvFyMwnFkYsxEYG6vq4uY86ed-ElihjmrBbGmFVCUGFIVqi4FIQpokbnazk5lh8IdIYL_YWV2ijN_yJeNICkaQGH7Y1zwtdGF0JJ4XpuxrGt-Hrq7UfeUdQFXNc0pepaokqT2K13JUw/s320/kotlin+eclipse+2.png)
Create a new project
Select File -> New -> Kotlin Project to create the Kotlin project:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQgAIxkk7FE098lAuVMD5dL0gI4cVEY671FQt-KeHaAqM82NolaOmH-99V1_qKXgoOzCvj_WQqH1R3fJXyiWoXZJwF10kzMeA4P5_nSvBElaTiSH9ZM3h1WN0-5HrgLQCPz2K0IDsz1iA/s320/kotlin+eclipse+3.png)
After the creation is successful, the project structure is as follows:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjspo3d80Z674AUStQitKSuLgHM4r9WOJY5X7KfMkOeo1SPW8mD_ShQAqhdXdmWkudA9IsaUIb6cl1xtZy3rB3e8GK1E9M-tZn9gcXxBT4xUck1fZ11UzAGUVLaby0ZfghTMZEiVvCjeHk/s1600/kotlin+eclipse+4.png)
Next, we click on the src folder to create a Kotlin file, without writing ".kt", the default is automatically added, it can be arbitrarily named, here we create hello
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigsbrw9FqbOuWUFcd0egc4CLuZJiqpN4PApUiO9YENd2LlVUprnZikLmj6Lod5E6zgrl9tqAZs-u2SZWHfBu3cZNx7KMJkpkRS6MyzvLKQ_YZEHWMXe-A7fHZ0yauL8wvIMgd7C8YwgB4/s320/kotlin+eclipse.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiioS2WWPlewLIgQFMOeU3p7xOVxtKnqEPIYAwsB3-iW7WiSMqdTdPnD7PqcqbEtKTjFMGEjOvXK8KInQsVIB3P1UZvq2_4Wi9tIChVtXjOq-S2XmFYVFj_7iTLz0hAWCZTa4CNwG9MHM/s320/kotlin+eclipse+5.png)
Next, we write the code in the hello.kt file. Eclipse gives us a template to do this quickly, just type main and press Enter
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAcYzPDWlU2fbZ9NPZsC2QdjH6Xe_Lg3SzRKyE6AIHyvace-1IeszO02VItBKjmgYZJCkpfGDYpJAyj9ME5DqIjjH2sROhElcjHZ4Y79A7Twdwm13wCRtgoHBRHnDkLAzYF6acj7g9xNw/s320/kotlin+eclipse.png)
Next, we write the code in the hello.kt file. Eclipse gives us a template to do this quickly, just type main and press Enter.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfhjE3TmyQV-J2g55IM_tj1325tt7IPCKAadmykJspX12IifVkfFrYINxuGytCAVoQfMaiL8gWNr5Q8-w36U3zWlj03KXXLXqxLlatTa1B_sNh6gQOVICusd6pdsh1dBihMmIqWRqZAUc/s320/kotlin+eclipse.png)
After running successfully, you can see the results in the Window Console.
No comments:
Post a Comment