I have eclipse "Oxygen" version for which I have installed the kotlin plugin by referring the official kotlin site . I have also referred this page on stack overflow, but none of the methods have helped me. I am unable to see "Run as kotlin application" option. This might be a duplicate question, but the original question's answers have not helped me.
Asked
Active
Viewed 740 times
2
-
What steps did you perform? How would someone reproduce exactly what you've done, not what it says in the instructions, what you did? – nitind Jun 17 '18 at 16:31
-
Possible duplicate of [Unable to Run Kotlin Application in Eclipse](https://stackoverflow.com/questions/40506227/unable-to-run-kotlin-application-in-eclipse) – Alex R Oct 03 '19 at 01:13
5 Answers
3
Remove curly braces around class and it will work :
class Hello
fun main () {
println("Hello World !!")
}

San
- 31
- 2
-
Thanks a lot. Not sure why you should do something like this but it worked – LiefLayer Sep 04 '20 at 08:15
1
In my case, I put the main() inside the class, after putting main() at the top level it worked.
Here are the screen shots for the reference:

Shishupal Shakya
- 1,632
- 2
- 18
- 41
0
i don't understand why this work...
fun main() {
println("Hola Mundo")
// if (args.size == 0)
// println("Te olvidaste los argumentos ...")
}
and this don't
fun main(args : List<String>) {
println("Hola Mundo")
// if (args.size == 0)
// println("Te olvidaste los argumentos ...")
}
when I add parameters to main function, the menu option Run as Kotlin ... disappear!
Any Idea ?
Best Regards

Nicolas400
- 563
- 1
- 7
- 29
-1
I had to ensure the project had Kotlin Nature (go to properties -> project natures) and then open the Kotlin perspective and then i saw the run as Kotlin application.

rupweb
- 3,052
- 1
- 30
- 57
-2
Try changing the Kotlin Plugin Version. There was a bug in one of the releases. Also if that doesn't work, switch to a newer version of the IDE, maybe Photon. That should make it work.

resound
- 21
- 4
-
What I have read is that the Kotlin plugin does not work in the more recent versions. – user118967 Jun 28 '20 at 03:42