Play 出错的未知原因!框架项目,仅在项目中使用 java
Unknown reason for error with Play! Framework project & use only java in project
我在最近创建的 Play 中遇到错误!项目,我不知道为什么。谁能帮我?我得到的错误如下:"index cannot be resolved"
我还有一个问题,在玩! framework web,它说了以下内容,但我不知道该怎么做,有人可以向我解释一下那是什么以及如何做吗?:
If you do not want to install Scala IDE and have only Java sources in your > project, then you can set the following:
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java // Java project. Don't expect Scala IDE
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources) // Use .class files instead of generated .scala files for views and routes
EclipseKeys.preTasks := Seq(compile in Compile) // Compile the project before generating Eclipse files, so that .class files for views and routes are present
第一题)
Eclipse 还不知道您的观点(也称为 templates)。它们是 Scala 类,将在编译期间从您的实际 my_view_name.scala.html
文件生成。所以在你编译之后你只需要 运行 activator eclipse
(或者 '
play eclipse
使用旧版本的 Play)并且这些错误神奇地消失了。
第二题)
我从来没有设置过those。我猜你必须在 project/plugins.sbt
中设置
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
并且,如果您不使用 Scala(仅 Java),在您的 build.sbt
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java // Java project. Don't expect Scala IDE
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources) // Use .class files instead of generated .scala files for views and routes
EclipseKeys.preTasks := Seq(compile in Compile) // Compile the project before generating Eclipse files, so that .class files for views and routes are present
我在最近创建的 Play 中遇到错误!项目,我不知道为什么。谁能帮我?我得到的错误如下:"index cannot be resolved"
我还有一个问题,在玩! framework web,它说了以下内容,但我不知道该怎么做,有人可以向我解释一下那是什么以及如何做吗?:
If you do not want to install Scala IDE and have only Java sources in your > project, then you can set the following:
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java // Java project. Don't expect Scala IDE
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources) // Use .class files instead of generated .scala files for views and routes
EclipseKeys.preTasks := Seq(compile in Compile) // Compile the project before generating Eclipse files, so that .class files for views and routes are present
第一题)
Eclipse 还不知道您的观点(也称为 templates)。它们是 Scala 类,将在编译期间从您的实际 my_view_name.scala.html
文件生成。所以在你编译之后你只需要 运行 activator eclipse
(或者 '
play eclipse
使用旧版本的 Play)并且这些错误神奇地消失了。
第二题)
我从来没有设置过those。我猜你必须在 project/plugins.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
并且,如果您不使用 Scala(仅 Java),在您的 build.sbt
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java // Java project. Don't expect Scala IDE
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources) // Use .class files instead of generated .scala files for views and routes
EclipseKeys.preTasks := Seq(compile in Compile) // Compile the project before generating Eclipse files, so that .class files for views and routes are present