Scala Eclipse IDE - strange behavior

半腔热情 提交于 2019-12-11 08:24:19

问题


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

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:


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.

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.



来源:https://stackoverflow.com/questions/9128463/scala-eclipse-ide-strange-behavior

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!