I added a Maven project with the "scala-archetype-simple" but post project creation, Scala source files are not being recognized by the compiler and i'm getting errors such as
"Syntax error on token ClassHeader expected instead"
and a lot of compilation errors saying "Java Problem"
How should this be fixed?
"Add Scala Nature" might not be enough. after that if you don't see "Scala Library" in your project, you can right click the project and go to "Scala" menu then click "Add Scala Library to Build Path", then it would work.
Right click on the project, select Configure -> Add Scala Nature.
This fixes the problem instantly.
It worked fine for me in Eclipse, but:
- you need to have the m2eclipse-scala connector installed.
- there are two
scala-archetype-simple
versions, make sure you're using version 1.5
, in group net.alchim31.maven
.