简体   繁体   English

将scala功能添加到现有的EJB eclipse项目中

[英]Add scala capabilities into an existing EJB eclipse project

I have an existing EJB project set up in Eclipse Helios, and would like to slowly introduce Scala into the project. 我已经在Eclipse Helios中建立了一个现有的EJB项目,并希望将Scala慢慢引入该项目中。 The Scala IDE has been installed successfully, and I'm able to create standalone scala project. Scala IDE已成功安装,我能够创建独立的scala项目。 The issue however comes when trying to use my existing project with scala additions. 但是,当尝试将我现有的项目与scala添加一起使用时,问题就来了。 I've went as far as manually editing the .project, .classpath, and related files under .settings of the project's home directory for eclipse. 我已经尝试过在项目主目录的.settings下手动编辑.project,.classpath和相关文件,以进行蚀。

However I still have the issue where the Java compiler tries to compiles .scala classes, which results in errors and ultimately not being able to build the project. 但是,我仍然遇到Java编译器尝试编译.scala类的问题,这会导致错误并最终无法构建项目。

Has anyone faced a similar scenario or are there any workarounds? 有没有人遇到过类似的情况,或者有任何解决方法?

Thanks in advance. 提前致谢。

You should be able to right-click the project, go to "Scala" and click on "add scala nature". 您应该能够右键单击该项目,转到“ Scala”,然后单击“添加scala性质”。 Then .scala files should be recognized as such. 然后,应将.scala文件识别为此类文件。 You might also have to add the scala library to your dependencies. 您可能还必须将scala库添加到依赖项。 Depending on whether this is a "simple" Eclipse project or you're using Maven there might be other steps required. 根据这是一个“简单” Eclipse项目还是您正在使用Maven,可能还需要其他步骤。

右键单击项目,然后选择“ 配置 /添加Scala性质”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM