播放框架Eclipse项目转换错误
我是一个新手玩框架,刚刚下载了play 2.4.2,创建了一个使用播放框架Eclipse项目转换错误,eclipse,playframework,scala-ide,playframework-2.4,Eclipse,Playframework,Scala Ide,Playframework 2.4,我是一个新手玩框架,刚刚下载了play 2.4.2,创建了一个使用 activator new 之后,我尝试将project转换为eclipse,但命令 activator eclipse 导致了错误 通过启动ActivatorUI并通过ActivatorWeb控制台将项目转换为eclipse,我已经将其转换为eclipse项目。但在UI中,我也看到了上面的错误消息,但它已经转换为eclipse项目 将项目导入eclipse,它在Application.java文件中显示错误,如下所示。
activator new
之后,我尝试将project转换为eclipse,但命令
activator eclipse
导致了错误
通过启动ActivatorUI并通过ActivatorWeb控制台将项目转换为eclipse,我已经将其转换为eclipse项目。但在UI中,我也看到了上面的错误消息,但它已经转换为eclipse项目
将项目导入eclipse,它在Application.java文件中显示错误,如下所示。
我已经下载了Scala IDE,尝试导入该项目,但仍然没有改变。
我已经使用命令行启动了应用程序
activator run
我的应用程序正在侦听9000,并在IDE中刷新了项目,但找不到符号仍未解决
跳转启动不平稳,如何解决这个问题?这值得一读。它解释了如何将一些设置添加到build.sbt
:
$ activator new eclipse
Fetching the latest list of templates...
Browse the list of templates: http://typesafe.com/activator/templates
Choose from these featured templates or enter a template name:
1) minimal-akka-java-seed
2) minimal-akka-scala-seed
3) minimal-java
4) minimal-scala
5) play-java
6) play-scala
(hit tab to see a list of all templates)
> 5
OK, application "eclipse" is being created using the "play-java" template.
To run "eclipse" from the command line, "cd eclipse" then:
/Users/ben/projects/eclipse/activator run
To run the test for "eclipse" from the command line, "cd eclipse" then:
/Users/ben/projects/eclipse/activator test
To run the Activator UI for "eclipse" from the command line, "cd eclipse" then:
/Users/ben/projects/eclipse/activator ui
$ cd eclipse/
$ echo 'addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")' >> project/plugins.sbt
$ ./activator compile
...
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.10/sbt_0.13/4.0.0/jars/sbteclipse-plugin.jar ...
[info] [SUCCESSFUL ] com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0!sbteclipse-plugin.jar (2998ms)
...
[info] Compiling 6 Scala sources and 2 Java sources to /Users/ben/projects/eclipse/target/scala-2.11/classes...
[success] Total time: 36 s, completed 05-Jul-2015 14:00:25
$ ./activator eclipse
[info] Loading project definition from /Users/ben/projects/eclipse/project
[info] Set current project to eclipse (in build file:/Users/ben/projects/eclipse/)
[info] About to create Eclipse project files for your project(s).
[info] Successfully created Eclipse project files for project(s):
[info] eclipse
$
然后作为ScalaIDE(您的Eclipse)中的现有项目导入。那么一切都会好起来。这里没问题
必须首先编译Scala模板(在启动项目并访问任何页面之后),然后eclipse项目必须使用引用库(包含这些类)来解决错误
尝试启动项目,访问一个页面,从activator控制台重新生成eclipse项目,然后再次导入IDE 您必须在项目的文件夹中启动activator,该文件夹是项目的
build.sbt
is。转到此文件夹,键入activator clean
,然后键入activator eclipse
(或activator idea
,对于Intellij idea),您的错误应该会消失。在project\plugins.sbt文件中添加了以下行//eclipse Plugin addSbtPlugin(“com.typesafe.sbteclipse”%”sbteclipse Plugin“%”4.0.0”)如前所述,我已将这些行添加到build.sbt中,但当我在CLI中说activator时,它抛出了错误:EclipseKeys.preTasks:=Seq(在编译中编译)^[error]类型表达式项目加载失败。我已进行了演练,我怀疑您正在使用Windows,在这种情况下,除了“echo”行之外,请执行相同的操作,您可以使用文本编辑器添加SBT Eclipse插件行。