Editor does not contain a main type

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

    I had this problem with a Java project that I imported from the file system (under Eclipse Helios). Here's a hint: the src code didn't seem to be compiled at all, as no "bin" directory showed up.

    I had to create a Java project from scratch (using the wizard), then compare the .project files of the non-working and working projects.

    The project giving "Editor does not contain a main type" had this as the "buildSpec" in the .project file:

    
    
    

    But the working project had this as the "buildSpec":

    
        
            org.eclipse.jdt.core.javabuilder
            
            
        
    
    

    I copied this in, and the imported project worked.

    I know my answer is for Java, but the same might be the issue for your Scala project.

提交回复
热议问题