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

I seem to be missing the libraries, but I'm not sure.

In this file:

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

      

I'm not sure what is causing these errors:

Description Resource    Path    Location    Type
Syntax error on token "object", 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 just need to go through the steps and do it in Netbeans, but I'd rather know what's going on.

In my elevator project that was built with maven, I don't have these errors, but there are a lot of jar files that I don't have in mine.

One jar file is scala -compiler-2.7.3.jar, which is in the elevator project but not in my scala project.

The only libraries in my scala project are Scala Library version 2.8.0r19106-...

andJRE System Library [jre1.6.0_07]

+2


source to share


3 answers


Eclipse sees and chokes on your Scala sources as Java (hint 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.

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



and if you still have problems look through the list of scala -id-users,

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

+13


source


The scala plugin for Eclipse is still pretty immature. If you are not locked into eclipse, I would suggest you try the netbeans plugin, which is more stable. :)



0


source


install scala plugin for eclipse add following site

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

it will work ...

0


source







All Articles