Scala Eclipse IDE - 奇怪的行为 [英] Scala Eclipse IDE - strange behavior

查看:156
本文介绍了Scala Eclipse IDE - 奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在很长一段时间之后,我尝试了Scala Eclipse IDE。我仅在前一段时间安装了Eclipse和所谓的Scala插件,但我无法获得工作。在所有的Scala文件中,我收到如下错误(请参阅工具提示):


此项目使用Gradle构建,并且我还安装了最新版本的Groovy插件。请帮我搞定这件事情。谢谢。

编辑:

谢谢大家。问题解决了。看来我的Scala插件安装出现问题。一切的完整重装(包括Eclipse)都有所帮助。我不知道Eclipse / Scala-IDE的哪个版本您正在使用,但我知道这有时会发生两个原因:


$ b $ 1您没有安装Scala的JDT编织。





< scala-ide使用方面将代码编织到JDT编译器中。如果你没有安装它,这可能会导致Scala文件被视为Java文件。



2)如果在某种程度上, Java源文件内容类型包含* .scala。实际上,它应该是 Scala Source File 。如果是这种情况,您应该从 Java源文件内容类型中移除* .scala。



< img src =https://i.stack.imgur.com/0tuYJ.pngalt =内容类型>


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.

解决方案

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.

这篇关于Scala Eclipse IDE - 奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆