Nig*_*olf 16 scala intellij-idea sbt sbt-idea playframework-2.0
我正在尝试使用最新的Play 2和Scala插件运行IntelliJ 13.1中的一个类型安全激活器项目.
我可以通过类型安全激活器运行项目没有问题但是当我尝试通过build.sbtIntelliJ中的文件打开激活器项目时,它似乎一直工作,直到我尝试通过Play 2 App运行配置运行该事物.我收到以下错误;
"C:\Program Files\Java\jdk1.8.0\bin\java" -Dfile.encoding=UTF8 -Djline.terminal=none -Dsbt.log.noformat=true -Dsbt.global.base=C:\Users\nw\AppData\Local\Temp\sbt-global-plugin5970836074908902993stub -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M -classpath C:\Users\nw\.IntelliJIdea13\config\plugins\Scala\launcher\sbt-launch.jar xsbt.boot.Boot run
Getting org.fusesource.jansi jansi 1.11 ...
:: retrieving :: org.scala-sbt#boot-jansi
confs: [default]
1 artifacts copied, 0 already retrieved (111kB/37ms)
Getting org.scala-sbt sbt 0.13.0 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
43 artifacts copied, 0 already retrieved (12440kB/109ms)
Getting Scala 2.10.2 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
5 artifacts copied, 0 already retrieved (24390kB/62ms)
[info] Set current project to modules (in build file:/J:/DEV/TYPESAFE/reactive-maps/.idea/modules/)
java.lang.RuntimeException: No main class detected.
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run 'last compile:run' for the full output.
[error] (compile:run) No main class detected.
[error] Total time: 0 s, completed 02/04/2014 10:31:12 PM
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
Process finished with exit code 1
Run Code Online (Sandbox Code Playgroud)
我的build.sbt看起来像这样;
name := """reactive-maps"""
version := "1.0-SNAPSHOT"
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.2.1",
"com.typesafe.akka" %% "akka-contrib" % "2.2.1",
"com.typesafe.play.extras" %% "play-geojson" % "1.0.0",
"org.webjars" %% "webjars-play" % "2.2.1",
"org.webjars" % "bootstrap" % "3.0.0",
"org.webjars" % "knockout" % "2.3.0",
"org.webjars" % "requirejs" % "2.1.8",
"org.webjars" % "leaflet" % "0.7.2"
)
play.Project.playScalaSettings
Run Code Online (Sandbox Code Playgroud)
只需sbt run从项目文件夹中的命令行运行就可以了.因此,导入SBT项目的方式存在一些问题.
Jlb*_*nte 17
你也可以用play来修复它
cd /path/to/project
play
[project] idea with-sources=yes
Run Code Online (Sandbox Code Playgroud)
现在您可以右键单击Application并运行Play2应用程序.
Snn*_*pie 10
刚遇到同样的问题 - 我的项目设置如下:
root/
.idea/
MainApp/ <-- this one is a Play 2.2.2 project
.idea/
apps/ <-- contains other Play2 projects
Run Code Online (Sandbox Code Playgroud)
我试图运行该MainApp项目并遇到同样的问题.
如果您在运行中发现错误: [info] Set current project to modules (in build file:/J:/DEV/TYPESAFE/reactive-maps/.idea/modules/)
声明它正在设置项目modules.你想要它reactive-maps.
我做了同样的事 - 我的快速解决方案:
- 找到文件.idea/modules/reactive-maps.iml,将其移动到根级reactive-maps/目录.
- 打开文件,Ctrl-F Ctrl-R(查找和替换)
- 查找:$MODULE_DIR$/../..替换为:$MODULE_DIR$/
此时再次运行Play2应用程序.
理想的解决方案是正确导入它(我确信有一种方法可以做到这一点),但这使我的应用程序快速运行IntelliJ(尽管它可能会在重启/ SBT刷新时中断).
| 归档时间: |
|
| 查看次数: |
9654 次 |
| 最近记录: |