无法在IntelliJ + sbt-idea-plugin中调试Scala应用程序

时间:2013-07-02 05:34:46

标签: scala intellij-idea sbt

我正在使用IntelliJ Idea 12,sbt和sbt-idea plugin开发Scala应用程序。我通过说“gen-idea”生成所有必要的文件,一切顺利 - 我能够使用菜单Build-> Make Project在sbt和IntelliJ Idea 12本身的命令行中编译源代码。

这是我的主要课程(Application.scala

object Application extends App {
  val a = 12345
  println("application entry point 1235")
}

我在val a = 12345有一个断点。

1)之前还有其他错误,但现在说“Module is not specified”。我该如何解决这个问题?

我会发布更新,因为我的直觉告诉我会有其他错误。

1 个答案:

答案 0 :(得分:16)

要像运行一样进行调试,您需要创建一个运行配置(菜单Run - > Edit Configurations)。如果您还没有完成,则需要使用+按钮添加Application条目。

您不仅需要指定主类,还需要指定该类所属的“模块”。默认情况下,“使用模块的类路径”将为空。在弹出菜单中,您需要选择主模块(而不是以“-build”结尾的模块)。选择并以“确定”关闭后,它应该有效。

enter image description here


虽然没有必要,但我也建议使用sbt来构建而不是“Make”。在“发布前”部分的配置中,选择“制作”并单击“ - ”,然后单击“+”并选择sbt - >试验:制品

修改Here is the reference获取IntelliJ的SBT插件。

相关问题