【问题标题】:Playframework create eclipse projectPlayframework 创建eclipse项目
【发布时间】:2015-05-11 13:33:35
【问题描述】:

我使用的是 play 版本,我无法通过命令行创建 eclipse 项目 playframework,我收到以下错误。我使用的是激活器版本 1.3.2; java -version 1.8 和 javac -version 1.6。 如何解决我的问题?

[myProject] $ eclipse
[info] About to create Eclipse project files for your project(s).
[info] Updating {file:/D:/activator-1.3.2-minimal/myProject/}root...
[info] Resolving org.scala-lang#scala-library;2.11.1 ...

[myProject] $ eclipse
[info] About to create Eclipse project files for your project(s).
[info] Updating {file:/D:/activator-1.3.2-minimal/myProject/}root...
[info] Resolving org.scala-lang#scala-library;2.11.1 ...
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:3: error: package play does not exist
[error] import play.*;
[error] ^
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:4: error: package play.mvc does not exist
[error] import play.mvc.*;
[error] ^
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:8: error: cannot find symbol
[error] public class Application extends Controller {
[error]                                  ^
[error]   symbol: class Controller
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:10: error: cannot find symbol
[error]     public static Result index() {
[error]                   ^
[error]   symbol:   class Result
[error]   location: class Application
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\ReverseAssets.class: warning: Cannot find annotation method 'bytes(
)' in type 'ScalaSignature': class file for scala.reflect.ScalaSignature not found
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\ReverseApplication.class: warning: Cannot find annotation method 'b
ytes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\javascript\ReverseAssets.class: warning: Cannot find annotation met
hod 'bytes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\javascript\ReverseApplication.class: warning: Cannot find annotatio
n method 'bytes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\ref\ReverseAssets.class: warning: Cannot find annotation method 'by
tes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\controllers\ref\ReverseApplication.class: warning: Cannot find annotation metho
d 'bytes()' in type 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\target\scala-2.11\classes\views\html\index.class: warning: Cannot find annotation method 'bytes()' in typ
e 'ScalaSignature'
[error] D:\activator-1.3.2-minimal\myProject\app\controllers\Application.java:11: error: cannot access Html
[error]         return ok(index.render("Your new application is ready."));
[error]                               ^
[error]   class file for play.twirl.api.Html not found
[error] 5 errors
[error] 7 warnings
[error] (compile:compile) javac returned nonzero exit code
[error] Could not create Eclipse project files:
[error] Error evaluating task 'dependencyClasspath': error

【问题讨论】:

  • 为什么你使用不同的Java版本来运行而不是编译?

标签: java eclipse playframework


【解决方案1】:

你可以先试试:

activator clean compile

【讨论】:

    【解决方案2】:

    将以下行添加到 {your project}project/plugins.sbt

    addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0")

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-04
      • 1970-01-01
      • 2011-11-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-18
      相关资源
      最近更新 更多