开发者

Scala errors in Eclipse 3.5 using Scala 2.8.0b, "Syntax error on token String"

I seem to be missing libraries but I am not certain.

In this file:

object Test {
    def main(args: Array[String]) {
        for (arg <- args)
            println(arg)
    }
}

I am not certain what leads to these errors:

Description Resource    Path    Location    Type
Syntax error on token "开发者_如何学JAVAobject", interface expected  TestSrc.scala   /ScalaDataMiningFunctions/src   line 1  Java Problem
Syntax error on token "String", delete this token   TestSrc.scala   /ScalaDataMiningFunctions/src   line 2  Java Problem
Syntax error on token ":", delete this token    TestSrc.scala   /ScalaDataMiningFunctions/src   line 2  Java Problem
Syntax error on token "<", ( expected   TestSrc.scala   /ScalaDataMiningFunctions/src   line 3  Java Problem

I may just need to go through the steps and do this in Netbeans instead, but I would prefer to find out what is going on.

In my lift project, which was created by using maven, I don't have these errors, but there are many jar files there that I don't have in mine.

One jar file is scala-compiler-2.7.3.jar that is in the lift project but not in my scala project.

The only libraries in my scala project are Scala Library version 2.8.0r19106-... and JRE System Library [jre1.6.0_07]


Eclipse is seeing your Scala sources as Java and choking on them (the clue is the text "Java Problem" at the end of each problem report).

Most likely you don't have JDT Weaving enabled (or not enabled successfully), so please follow the troubleshooting instructions here,

http://scala-ide.assembla.com/wiki/show/scala-ide/Troubleshooting

and if you still have issues, please follow up on the scala-ide-user list,

http://groups.google.com/group/scala-ide-user


The scala plugin for Eclipse is still quite immature. If you are not locked into eclipse i would advise you to try out the netbeans plugin which is alot more stable. :)


please install scala plugin to eclipse add following site

http://download.scala-ide.org/update-current-35

it will work...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜