Editor does not contain a main type

后端 未结 30 2396
执笔经年
执笔经年 2020-11-27 13:51

Just going through the sample Scala code on Scala website, but encountered an annoying error when trying to run it.

Here\'s the code: http://www.scala-lang.org/node/

30条回答
  •  隐瞒了意图╮
    2020-11-27 14:54

    That code is valid. Have you tried to compile it by hand using scalac? Also, have you called your file "addressbook", all lowercase, like the name of the object?

    Also, I found that Eclipse, for some reason, set the main class to be ".addressbook" instead of "addressbook".

提交回复
热议问题