[英]Play framework - java.lang.RuntimeException: No main class detected
I am new to play framework and trying to run securesocial as in https://github.com/jaliss/securesocial Using Play 2.3, Scala 2.10.0 我是新手玩框架并尝试运行securesocial,如https://github.com/jaliss/securesocial使用Play 2.3,Scala 2.10.0
.sbt file is configured as .sbt文件配置为
name := "SecureSocial-parent"
version := Common.version
scalaVersion := Common.scalaVersion
lazy val core = project.in( file("module-code") ).enablePlugins(PlayScala)
lazy val scalaDemo = project.in( file("samples/scala/demo") ).enablePlugins(PlayScala).dependsOn(core)
lazy val javaDemo = project.in( file("samples/java/demo") ).enablePlugins(PlayJava).dependsOn(core)
lazy val root = project.in( file(".") ).aggregate(core, scalaDemo, javaDemo) .settings(
aggregate in update := false
)
But getting below error 但低于错误
~\securesocial-master>activator run
[info] Loading project definition from ~\securesocial-master\project
[info] Set current project to SecureSocial-parent (in build file:~/securesocial-master/)
java.lang.RuntimeException: No main class detected.
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last securesocial-master/compile:run for the full output.
[error] (securesocial-master/compile:run) No main class detected.
The project compiled successfully with many warnings on deprecated API Any pointer will be useful on how to resolve the no main class error 该项目已成功编译,对已弃用的API提出了许多警告。任何指针对于解决无主类错误都很有用
Just had the same problem. 刚遇到同样的问题。 I am using the scala version though.
我虽然使用scala版本。 I am running the sample app directly from the samples/scala/demo folder (by typing activator in the terminal).
我正在从samples / scala / demo文件夹中直接运行示例应用程序(通过在终端中键入activator)。
The key to get it up and running was to add the following line to scalaDemo.sbt 启动和运行的关键是将以下行添加到scalaDemo.sbt
lazy val root = (project in file(".")).enablePlugins(PlayScala)
which should probably be 应该是
lazy val root = (project in file(".")).enablePlugins(PlayJava)
into the javaDemo.sbt file, since you are running the Java version. 进入javaDemo.sbt文件,因为您正在运行Java版本。
I can see when the app starts that I have problems loading some gifs in the public folder, so maybe it is a wrong approach. 我可以看到应用程序何时启动,我在公共文件夹中加载一些GIF时遇到问题,所以这可能是一个错误的方法。
As far as I understand it, SecureSocial-parent is just the library - it can be compiled, but cannot be run per se. 据我所知,SecureSocial-parent只是库 - 它可以编译,但本身不能运行 。 You can only run the demo projects.
您只能运行演示项目。 For example, if you start
activator
in the securesocial
directory, you can type 例如,如果在
securesocial
目录中启动activator
,则可以键入
project javaDemo
to switch to the Java demo project and then 然后切换到Java演示项目
~run
to run it. 运行它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.