Scala/Eclipse-文件未编译 [英] Scala/ Eclipse - Files not compiling

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

问题描述

我添加了一个带有"scala-archetype-simple"的Maven项目,但是在项目创建后,编译器无法识别Scala源文件,并且出现了

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"

以及许多编译错误,提示"Java问题"

and a lot of compilation errors saying "Java Problem"

应该如何解决?

推荐答案

添加Scala自然"可能还不够.之后,如果您在项目中没有看到"Scala库",则可以右键单击该项目并转到"Scala"菜单,然后单击将Scala库添加到构建路径",这样就可以了.

"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.

这篇关于Scala/Eclipse-文件未编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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