Editor does not contain a main type

后端 未结 30 2446
执笔经年
执笔经年 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:30

    I had the same problem. I tried all sorts of things. And I came to know that

    1. My .java files were not linked and
    2. they were not placed in the 'src' folder.

    Things I did:

    Project properties >> Java Build Path >> Source

    • Deleted the original 'src' folder which was empty using 'Remove' option
    • Added the source that contained my source .java files using the 'Add Folder' option

    This solved the error.

提交回复
热议问题