将scala功能添加到现有的EJB eclipse项目中 [英] Add scala capabilities into an existing EJB eclipse project

查看:171
本文介绍了将scala功能添加到现有的EJB eclipse项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse Helios中设置了一个现有的EJB项目,并希望慢慢地将Scala引入该项目。 Scala IDE已经成功安装,我可以创建独立的scala项目。但是,当试图使用我现有的项目添加scala时,这个问题就出现了。我已经远程手动编辑.project,.classpath和相关的文件在.settings项目的eclipse目录下。



但是,我仍然遇到Java编译器尝试编译.scala类的问题,导致错误,最终无法构建项目。



有没有人遇到类似的情况或有任何解决方法?



提前感谢。

解决方案

您应该能够右键单击项目,转到Scala,然后单击添加scala性质。那么 .scala 文件应该被识别。您可能还需要将Scala库添加到依赖关系中。根据这是否是一个简单的Eclipse项目,或者您使用的是Maven,可能还需要其他步骤。


I have an existing EJB project set up in Eclipse Helios, and would like to slowly introduce Scala into the project. The Scala IDE has been installed successfully, and I'm able to create standalone scala project. The issue however comes when trying to use my existing project with scala additions. I've went as far as manually editing the .project, .classpath, and related files under .settings of the project's home directory for eclipse.

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.

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". Then .scala files should be recognized as such. You might also have to add the scala library to your dependencies. Depending on whether this is a "simple" Eclipse project or you're using Maven there might be other steps required.

这篇关于将scala功能添加到现有的EJB eclipse项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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