我想用LibGDX创建一个新的SBT项目,并使用IntelliJ作为我的IDE。我已经尝试了这些instructions,即使我成功完成了g8设置过程,我也无法通过SBT shell运行该项目。
[IJ]> desktop/run
[error] Expected ID character
[error] Not a valid command: desktop
[error] Expected project ID
[error] Expected configuration
[error] Expected ':' (if selecting a configuration)
[error] Expected key
[error] Not a valid key: desktop (similar: test, skip, description)
[error] desktop/run
[error] ^
[IJ]> run
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 Nov 18, 2017 5:45:03 PM
[IJ]> baseDirectory
[info] C:\Users\<MyName>\IdeaProjects\MyProject
[IJ]>
答案 0 :(得分:0)
我想通了,当我运行g8模板时,它自动创建了一个带有项目名称的文件夹 - 所以我的文件夹结构看起来像C:\ Users \ MyName \ IdeaProject \ MyProject \ myproject。我在C:\ Users \ MyName \ IdeaProject \ MyProject中运行了sbt,当我应该在C:\ Users \ MyName \ IdeaProject \ MyProject \ myproject中运行它时,它创建了一个不正确的sbt构建。
此外,ios模块失败但我不打算以ios为目标,所以我从build.scala和plugins.sbt中删除了roboscala插件和ios变量。