kotlin-playground icon indicating copy to clipboard operation
kotlin-playground copied to clipboard

"No main method found in project" with main method actually present

Open ginz opened this issue 4 months ago • 0 comments

  • This snippet works fine: https://pl.kotl.in/JCOc0ANsA (expected timeout failure)
  • This snippet (only different by one line that has nothing to do with function declarations) fails with "No main method found in project": https://pl.kotl.in/wqDvYaWA5

Exception message:

Exception in thread "main" java.lang.IllegalArgumentException: No main method found in project
 at com.compiler.server.compiler.components.KotlinCompiler.run$lambda$3 (KotlinCompiler.kt:67) 
 at com.compiler.server.compiler.components.KotlinCompiler.execute$lambda$16 (KotlinCompiler.kt:148) 
 at com.compiler.server.compiler.components.CliUtilsKt.usingTempDirectory (CliUtils.kt:119) 
Image
  • Switching to other compiler versions, both higher and lower, doesn't help
  • Adding args: Array<String> to the main arguments doesnt help

ginz avatar Jun 18 '25 10:06 ginz