Scala Eclipse IDE - strange behavior

2019-07-23 16:08发布

I am giving a try to Scala Eclipse IDE after a very long time. I installed Eclipse and the said Scala plugin only a while ago, but I am unable to get stuff working. In all of the Scala files, I get the errors like following (See the tooltip):

enter image description here

This project uses Gradle for building, and I also have the latest version of Groovy plugin installed. Please help me get this thing working. Thanks.

Edit:

Thank you, everyone. The problem was solved. It appears there was a problem with my Scala plugin installation. A complete reinstall of everything (including Eclipse) helped. Also, this time I did not install the Groovy plugin.

1条回答
男人必须洒脱
2楼-- · 2019-07-23 16:35

I don't know which version of Eclipse / Scala-IDE you're using, but there are two reasons I know this sometimes happens:

1) You don't have JDT weaving for Scala installed.

Installation details

The scala-ide uses aspects to weave in code into the JDT compiler. If you don't have this installed, this may cause the Scala files to be seen as Java files.

2) If, somehow, the Java Source File content type includes *.scala. In fact, it should be Scala Source File. If this is the case, you should remove the *.scala from the Java Source File content type.

Content Types

查看更多
登录 后发表回答