views:

1215

answers:

4

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 "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 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]

A: 

Could it be this problem?

starblue
+10  A: 

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

Miles Sabin
+1 - Thank you, I didn't have JDT Weaving enabled, and I pointed eclipse to a newer version of JDK.
James Black
A: 

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. :)

Wolfslack
A: 

please install scala plugin to eclipse add following site

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

it will work...

sagar
It works now with no problem, but about 1 yr ago there was a problem, but thank you for your response.
James Black