由Play Framework生成的Scala项目的Eclipse错误 [英] Errors in Eclipse for Scala project generated by Play Framework

查看:79
本文介绍了由Play Framework生成的Scala项目的Eclipse错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Eclipse作为IDE用于Scala Web应用程序,使用 Play Framework 。我下载了Eclipse 3.6.2。然后,我为Eclipse安装了 Scala IDE 2.0(beta))。我下载了 Play Framework 1.2.2RC1 并安装了 Scala Module 使用播放安装scala-0.9.1 并生成一个新网站,播放新的mysite的。然后,我用播放eclipsify mysite 并在Eclipse中导入该项目,将其删除。

I would like to use Eclipse as IDE for a Scala web application using Play Framework. I downloaded Eclipse 3.6.2. Then I installed Scala IDE 2.0 (beta) for Eclipse. I downloaded Play Framework 1.2.2RC1 and installed the Scala Module using play install scala-0.9.1 and generated a new site with play new mysite. Then I eclipsified it with play eclipsify mysite and imported the project in Eclipse.

但是现在我收到很多错误蚀。这是什么我可以修复或不同的项目不兼容?

But now I get many errors in Eclipse. Is this anything I can fix or are the different projects incompatible?

这是生成的代码,其中包含Eclipse中的错误(但是,当我运行应用程序时它工作) / p>

This is the generated code that contains errors in Eclipse (but it works when I run the application).

package controllers

import play._
import play.mvc._

object Application extends Controller {

  import views.Application._

    def index = {
        html.index("Your Scala application is ready to go home!")
    } 
}

这是怎么回事看起来像在Eclipse中:

And this is how it looks like in Eclipse:

推荐答案

屏幕截图中突出显示的错误是由于新的Scala模板源不在项目构建路径中。 eclipsify命令当前没有为您执行此操作。

The error shown highlighted in your screenshot is caused by the new Scala template sources not being in the project Build Path. The eclipsify command doesn't currently do this for you.

手动添加tmp / classes到构建路径以解决它。

Manually add tmp/classes to the Build Path to resolve it.

但请注意,不会在Eclipse中生成新的Scala模板文件。所以如果你添加一个新的模板/页面到你的项目,你必须先运行播放运行(或等效的),使文件出现在那里。另请注意,如果您以后再次运行eclipsify命令,则需要将该文件夹重新添加到构建路径。

But please note that new Scala template files are not generated from within Eclipse. So if you add a new template/page to your project, you must run 'play run' (or equivalent) first to have the file appear there. Also note that if you run the eclipsify command again in the future you will need to re-add this folder to your Build Path.

这篇关于由Play Framework生成的Scala项目的Eclipse错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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