Eclipse not recognizing Scala code

前端 未结 11 2640
说谎
说谎 2021-02-18 19:20

I have Eclipse Indigo with the Scala IDE plugin. I downloaded a lift project from Maven. It builds correctly. Eclipse says it is viewing it with the Scala editor.

How

11条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-18 19:41

    I've had this problem before as well when using Maven and Eclipse - I'll be working in the Scala perspective and everything is fine, and then at some point Indigo completely loses track of the fact that it's using Scala and is building my code with a Java compiler. No amount of fiddling with Build Path and configurations, cleaning projects or enabling the Scala nature seems to fix it.

    The only solution I've come up with so far is to use IntelliJ when I use Maven, and use Scala Eclipse plugin only when using SBT to build projects. You can try converting your Maven POM to an SBT project, but you'll have to update that every time your dependencies change. Heiko Seeberger's sbt-eclipse plugin is pretty slick.

提交回复
热议问题